HomePhabricator
Diffusion Comm 03b900a71b56

[sqlite] implement C++ integrity store ops

Tags
None
Referenced Files
F1316633: image.png
Mar 25 2024, 2:11 PM
File Not Attached
Subscribers
None

Description

[sqlite] implement C++ integrity store ops

Summary:
This introduces the necessary code to call C++ integrity store sqlite ops from native

Depends on D11300

Test Plan:
Ran the following code:

async function run_test() {
  console.log('running run_test()');
  const TEST_THREAD_HASHES_1: $ReadOnlyArray<ClientDBIntegrityThreadHash> = [
    { id: '256|2202182', threadHash: 2304934 },
  ];

  const TEST_THREAD_HASHES_2: $ReadOnlyArray<ClientDBIntegrityThreadHash> = [
    { id: '256|2204191', threadHash: 1029853 },
    { id: '256|2205980', threadHash: 3119392 },
    { id: '256|2208693', threadHash: 4157082 },
    { id: '256|2210486', threadHash: 3425604 },
    { id: '256|2212631', threadHash: 8951764 },
  ];

  await commCoreModule.processIntegrityStoreOperations([
    {
      type: 'replace_integrity_thread_hashes',
      payload: {
        threadHashes: TEST_THREAD_HASHES_1,
      },
    },
    {
      type: 'remove_all_integrity_thread_hashes',
    },
    {
      type: 'replace_integrity_thread_hashes',
      payload: {
        threadHashes: TEST_THREAD_HASHES_2,
      },
    },
    {
      type: 'remove_integrity_thread_hashes',
      payload: {
        ids: ['256|2205980', '256|2212631'],
      },
    },
  ]);
}

After calling run_test(), sqlite table on native matches intended operation result:

image.png (814×2 px, 275 KB)

Reviewers: tomek, kamil

Reviewed By: kamil

Subscribers: ashoat

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

Details

Provenance
willAuthored on Mar 11 2024, 12:11 AM
Reviewer
kamil
Differential Revision
D11306: [sqlite] implement C++ integrity store ops
Parents
rCOMMc12a268115b2: [sqlite] add methods to operate on integrity store table
Branches
Unknown
Tags
Unknown