[SQLite] implement processing keyserver store ops on worker
Summary:
Code for web worker
Depends on D10780
Test Plan:
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);
Reviewers: inka
Reviewed By: inka
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D10781