Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33320523
D11354.1768843349.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D11354.1768843349.diff
View Options
diff --git a/web/redux/persist.js b/web/redux/persist.js
--- a/web/redux/persist.js
+++ b/web/redux/persist.js
@@ -15,10 +15,12 @@
type StorageMigrationFunction,
} from 'lib/shared/create-async-migrate.js';
import { keyserverStoreTransform } from 'lib/shared/transforms/keyserver-store-transform.js';
+import { defaultCalendarQuery } from 'lib/types/entry-types.js';
import type { KeyserverInfo } from 'lib/types/keyserver-types.js';
import { cookieTypes } from 'lib/types/session-types.js';
import { defaultConnectionInfo } from 'lib/types/socket-types.js';
import { defaultGlobalThemeInfo } from 'lib/types/theme-types.js';
+import { getConfig } from 'lib/utils/config.js';
import { parseCookies } from 'lib/utils/cookie-utils.js';
import { isDev } from 'lib/utils/dev-utils.js';
import { wipeKeyserverStore } from 'lib/utils/keyserver-store-utils.js';
@@ -262,6 +264,53 @@
return handleReduxMigrationFailure(state);
}
},
+ [12]: async (state: AppState) => {
+ const sharedWorker = await getCommSharedWorker();
+ const isSupported = await sharedWorker.isSupported();
+ if (!isSupported) {
+ return state;
+ }
+ const replaceOps: $ReadOnlyArray<ReplaceKeyserverOperation> = entries(
+ state.keyserverStore.keyserverInfos,
+ )
+ .filter(([, keyserverInfo]) => !keyserverInfo.actualizedCalendarQuery)
+ .map(([id, keyserverInfo]) => ({
+ type: 'replace_keyserver',
+ payload: {
+ id,
+ keyserverInfo: {
+ ...keyserverInfo,
+ actualizedCalendarQuery: defaultCalendarQuery(
+ getConfig().platformDetails.platform,
+ ),
+ },
+ },
+ }));
+ if (replaceOps.length === 0) {
+ return state;
+ }
+
+ const newState = {
+ ...state,
+ keyserverStore: keyserverStoreOpsHandlers.processStoreOperations(
+ state.keyserverStore,
+ replaceOps,
+ ),
+ };
+ const keyserverStoreOperations =
+ keyserverStoreOpsHandlers.convertOpsToClientDBOps(replaceOps);
+
+ try {
+ await sharedWorker.schedule({
+ type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
+ storeOperations: { keyserverStoreOperations },
+ });
+ return newState;
+ } catch (e) {
+ console.log(e);
+ return handleReduxMigrationFailure(newState);
+ }
+ },
};
const migrateStorageToSQLite: StorageMigrationFunction = async debug => {
@@ -307,7 +356,7 @@
{ debug: isDev },
migrateStorageToSQLite,
): any),
- version: 11,
+ version: 12,
transforms: [keyserverStoreTransform],
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 5:22 PM (19 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5957473
Default Alt Text
D11354.1768843349.diff (2 KB)
Attached To
Mode
D11354: [web] Introduce a migration that adds an actualizedCalendarQuery
Attached
Detach File
Event Timeline
Log In to Comment