Code for web worker
Depends on D10780
Differential D10781
[SQLite] implement processing keyserver store ops on worker kamil on Jan 22 2024, 5:32 AM. Authored by Tags None Referenced Files
Details Code for web worker Depends on D10780 Call this code: const databaseModule = await getDatabaseModule(); let data = await databaseModule.schedule({ type: workerRequestMessageTypes.GET_CLIENT_STORE, }); console.log(data.store.keyservers); await databaseModule.schedule({ type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS, storeOperations: { keyserverStoreOperations: [ { type: 'replace_keyserver', payload: { id: '1', keyserverInfo: 'fdfd', }, }, { type: 'replace_keyserver', payload: { id: '2', keyserverInfo: 'fdfd', }, }, ], }, }); data = await databaseModule.schedule({ type: workerRequestMessageTypes.GET_CLIENT_STORE, }); console.log(data.store.keyservers); await databaseModule.schedule({ type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS, storeOperations: { keyserverStoreOperations: [ { type: 'replace_keyserver', payload: { id: '2', keyserverInfo: 'fdfd45454545', }, }, ], }, }); data = await databaseModule.schedule({ type: workerRequestMessageTypes.GET_CLIENT_STORE, }); console.log(data.store.keyservers); await databaseModule.schedule({ type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS, storeOperations: { keyserverStoreOperations: [ { type: 'remove_keyservers', payload: { ids: ['1'], }, }, ], }, }); data = await databaseModule.schedule({ type: workerRequestMessageTypes.GET_CLIENT_STORE, }); console.log(data.store.keyservers); await databaseModule.schedule({ type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS, storeOperations: { keyserverStoreOperations: [ { type: 'remove_all_keyservers', }, ], }, }); data = await databaseModule.schedule({ type: workerRequestMessageTypes.GET_CLIENT_STORE, }); console.log(data.store.keyservers);
Diff Detail
|