Page MenuHomePhabricator

[sqlite] implement C++ code to get synced metadata
ClosedPublic

Authored by will on Mar 27 2024, 3:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 12:45 AM
Unknown Object (File)
Tue, Nov 12, 10:55 PM
Unknown Object (File)
Fri, Nov 1, 9:22 PM
Unknown Object (File)
Fri, Nov 1, 9:21 PM
Unknown Object (File)
Fri, Nov 1, 9:21 PM
Unknown Object (File)
Fri, Nov 1, 8:56 PM
Unknown Object (File)
Oct 22 2024, 2:47 PM
Unknown Object (File)
Oct 22 2024, 2:47 PM
Subscribers

Details

Summary

Introduces code necessary for native ops for getting the synced metadata store

Depends on D11418

Test Plan

Later diffs will utilize this code to read the synced metadata into redux.

As in the previous diff, ran the following code:

async function run_test() {
  console.log('running run_test()');

  await commCoreModule.processSyncedMetadataStoreOperations([
    {
      type: 'remove_all_synced_metadata',
    },
  ]);

  let data = await commCoreModule.getClientDBStore();
  console.log(data.syncedMetadata);

  await commCoreModule.processSyncedMetadataStoreOperations([
    {
      type: 'replace_synced_metadata_entry',
      payload: {
        name: 'test_B_name',
        data: 'test_B_data',
      },
    },
    {
      type: 'replace_synced_metadata_entry',
      payload: {
        name: 'test_A_name',
        data: 'test_A_data',
      },
    },
    {
      type: 'replace_synced_metadata_entry',
      payload: {
        name: 'test_A_name',
        data: 'test_A_update',
      },
    },
    {
      type: 'remove_synced_metadata',
      payload: { names: ['test_B_name'] },
    },
  ]);

  data = await commCoreModule.getClientDBStore();
  console.log(data.syncedMetadata);
}

And received the correct response of [{"data": "test_A_update", "name": "test_A_name"}]

Screenshot 2024-03-27 at 6.22.06 PM.png (768×846 px, 139 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable