HomePhabricator
Diffusion Comm ea325d9df057

[sqlite] implement processing synced metadata store ops on worker

Description

[sqlite] implement processing synced metadata store ops on worker

Summary:
This code allows the shared worker on web to use synced metadata sqlite ops

Depends on D11419

Test Plan:
Ran the following code:

const sharedWorker = await getCommSharedWorker();

const op_response = await sharedWorker.schedule({
  type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
  storeOperations: {
    syncedMetadataStoreOperations: [
      {
        type: 'replace_synced_metadata_entry',
        payload: {
          name: 'worker_test_A_name',
          data: 'worker_test_A_data',
        },
      },
      {
        type: 'replace_synced_metadata_entry',
        payload: {
          name: 'worker_test_B_name',
          data: 'worker_test_B_update',
        },
      },
      {
        type: 'replace_synced_metadata_entry',
        payload: {
          name: 'worker_test_A_name',
          data: 'worker_test_A_update',
        },
      },
      {
        type: 'remove_synced_metadata',
        payload: {
          names: ['worker_test_B_name'],
        },
      },
    ],
  },
});

if (!op_response) {
  return;
}

and confirmed result by downloading the web database:

Screenshot 2024-03-27 at 7.07.47 PM.png (766×1 px, 155 KB)

Reviewers: kamil, ginsu, atul

Reviewed By: kamil

Subscribers: ashoat, tomek

Differential Revision: https://phab.comm.dev/D11420

Details

Provenance
willAuthored on Mar 21 2024, 9:29 PM
Reviewer
kamil
Differential Revision
D11420: [sqlite] implement processing synced metadata store ops on worker
Parents
rCOMMb0cdf069f964: [sqlite] implement C++ code to get synced metadata
Branches
Unknown
Tags
Unknown