Page MenuHomePhabricator

[sqlite] Implement C++ code to get integrity store thread hashes
ClosedPublic

Authored by will on Mar 11 2024, 2:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 12:07 PM
Unknown Object (File)
Wed, Apr 24, 3:39 PM
Unknown Object (File)
Apr 7 2024, 11:09 PM
Unknown Object (File)
Apr 3 2024, 2:18 AM
Unknown Object (File)
Apr 3 2024, 2:18 AM
Unknown Object (File)
Apr 1 2024, 1:11 AM
Unknown Object (File)
Mar 23 2024, 2:29 AM
Unknown Object (File)
Mar 18 2024, 10:20 AM
Subscribers

Details

Summary

This implements native code to get all integrity store thread hashes.

Depends on D11306

Test Plan

Ran the following code on native and received correct console log result:

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

  await commCoreModule.processIntegrityStoreOperations([
    {
      type: 'remove_all_integrity_thread_hashes',
    },
  ]);

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

  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'],
      },
    },
  ]);

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

image.png (222×1 px, 43 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 11 2024, 2:45 PM
Harbormaster failed remote builds in B27456: Diff 38005!
will published this revision for review.Mar 11 2024, 10:21 PM

Please fix Android build before landing

This revision is now accepted and ready to land.Mar 12 2024, 10:19 AM