Skip to content

Commit

Permalink
[native][web] Add migration to unshim Blob-hosted multimedia
Browse files Browse the repository at this point in the history
Summary:
Point 3c from [[ https://linear.app/comm/issue/ENG-6459/launch-of-encrypted-media#comment-974e1b67 | ENG-6459 ]].

Depends on D13888

Test Plan:
1. Before applying D13888 and this, I sent some encrypted multimedia messages. They appeared as robotext
2. Applied both diffs and ran migration
3. Multimedia messages appeared normally

Reviewers: ashoat

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D13889
  • Loading branch information
barthap committed Nov 7, 2024
1 parent 0b058dc commit 30f6d90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion native/redux/persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,7 @@ const migrations: MigrationsManifest<NavInfo, AppState> = Object.freeze({
state,
ops: {},
}): MigrationFunction<NavInfo, AppState>),
[85]: (state: AppState) => unshimClientDB(state, [messageTypes.MULTIMEDIA]),
});

// NOTE: renaming this object, and especially the `version` property
Expand All @@ -1506,7 +1507,7 @@ const persistConfig = {
storage: AsyncStorage,
blacklist: persistBlacklist,
debug: __DEV__,
version: 84,
version: 85,
transforms: [
messageStoreMessagesBlocklistTransform,
reportStoreTransform,
Expand Down
2 changes: 1 addition & 1 deletion web/redux/persist-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
const rootKey = 'root';
const rootKeyPrefix = 'persist:';
const completeRootKey = `${rootKeyPrefix}${rootKey}`;
const storeVersion = 84;
const storeVersion = 85;

export { rootKey, rootKeyPrefix, completeRootKey, storeVersion };
4 changes: 4 additions & 0 deletions web/redux/persist.js
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,10 @@ const migrations: MigrationsManifest<WebNavInfo, AppState> = {
};
return { state, ops: operations };
}: MigrationFunction<WebNavInfo, AppState>),
[85]: (async (state: AppState) => ({
state,
ops: {},
}): MigrationFunction<WebNavInfo, AppState>),
};

const persistConfig: PersistConfig = {
Expand Down

0 comments on commit 30f6d90

Please sign in to comment.