diff --git a/lib/backup/persist-shared-migrations.js b/lib/backup/persist-shared-migrations.js --- a/lib/backup/persist-shared-migrations.js +++ b/lib/backup/persist-shared-migrations.js @@ -60,6 +60,39 @@ // don't support this message type. return {}; }: SharedMigrationFunction), + [98]: (async (databaseIdentifier: DatabaseIdentifier) => { + const { sqliteAPI } = getConfig(); + + const clientStoreToMigrate = + await sqliteAPI.getClientDBStore(databaseIdentifier); + + if (!clientStoreToMigrate.syncedMetadata) { + return {}; + } + + const alertStore = JSON.parse( + clientStoreToMigrate.syncedMetadata[syncedMetadataNames.ALERT_STORE], + ); + const updatedAlertStore = { + ...alertStore, + alertInfos: { + ...alertStore.alertInfos, + [alertTypes.CONNECT_FARCASTER_DCS]: defaultAlertInfo, + }, + }; + + const syncedMetadataStoreOperations: $ReadOnlyArray = + [ + createReplaceSyncedMetadataOperation( + syncedMetadataNames.ALERT_STORE, + JSON.stringify(updatedAlertStore), + ), + ]; + + return { + syncedMetadataStoreOperations, + }; + }: SharedMigrationFunction), }; export { sharedMigrations }; diff --git a/lib/types/alert-types.js b/lib/types/alert-types.js --- a/lib/types/alert-types.js +++ b/lib/types/alert-types.js @@ -5,6 +5,7 @@ CONNECT_FARCASTER: 'connect-farcaster', SIWE_BACKUP_MESSAGE: 'siwe-backup-message', DISPLAY_DIRECTORY_PROMPT: 'display-directory-prompt', + CONNECT_FARCASTER_DCS: 'connect-farcaster-dcs', }); type AlertType = $Values; @@ -39,6 +40,7 @@ [alertTypes.CONNECT_FARCASTER]: defaultAlertInfo, [alertTypes.SIWE_BACKUP_MESSAGE]: defaultAlertInfo, [alertTypes.DISPLAY_DIRECTORY_PROMPT]: defaultAlertInfo, + [alertTypes.CONNECT_FARCASTER_DCS]: defaultAlertInfo, }); const securityUpdateLogoutText: string = diff --git a/native/redux/persist-constants.js b/native/redux/persist-constants.js --- a/native/redux/persist-constants.js +++ b/native/redux/persist-constants.js @@ -5,6 +5,6 @@ // NOTE: renaming this constant requires updating // `native/native_rust_library/build.rs` to correctly // scrap Redux state version from this file. -const storeVersion = 97; +const storeVersion = 98; export { rootKey, storeVersion }; diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -1723,6 +1723,13 @@ ops, }; }: MigrationFunction), + [98]: (async (state: AppState) => { + const ops = await sharedMigrations[98](databaseIdentifier.MAIN); + return { + state, + ops, + }; + }: MigrationFunction), }); const persistConfig = { diff --git a/web/redux/persist-constants.js b/web/redux/persist-constants.js --- a/web/redux/persist-constants.js +++ b/web/redux/persist-constants.js @@ -3,6 +3,6 @@ const rootKey = 'root'; const rootKeyPrefix = 'persist:'; const completeRootKey = `${rootKeyPrefix}${rootKey}`; -const storeVersion = 97; +const storeVersion = 98; export { rootKey, rootKeyPrefix, completeRootKey, storeVersion }; diff --git a/web/redux/persist.js b/web/redux/persist.js --- a/web/redux/persist.js +++ b/web/redux/persist.js @@ -932,6 +932,13 @@ ops, }; }: MigrationFunction), + [98]: (async (state: AppState) => { + const ops = await sharedMigrations[97](databaseIdentifier.MAIN); + return { + state, + ops, + }; + }: MigrationFunction), }; const persistConfig: PersistConfig = {