Page MenuHomePhabricator

[sqlite] implement processing synced metadata store ops on worker
ClosedPublic

Authored by will on Mar 27 2024, 4:09 PM.
Tags
None
Referenced Files
F3401433: D11420.diff
Mon, Dec 2, 12:05 PM
Unknown Object (File)
Wed, Nov 13, 12:45 AM
Unknown Object (File)
Tue, Nov 12, 10:38 PM
Unknown Object (File)
Nov 1 2024, 9:14 PM
Unknown Object (File)
Nov 1 2024, 9:14 PM
Unknown Object (File)
Nov 1 2024, 9:14 PM
Unknown Object (File)
Nov 1 2024, 8:53 PM
Unknown Object (File)
Oct 30 2024, 7:47 AM
Subscribers

Details

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)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable