Page MenuHomePhabricator

[sqlite] implement C++ integrity store ops
ClosedPublic

Authored by will on Mar 11 2024, 12:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 4:58 AM
Unknown Object (File)
Sun, Nov 10, 3:47 PM
Unknown Object (File)
Fri, Nov 8, 12:12 AM
Unknown Object (File)
Thu, Nov 7, 10:29 PM
Unknown Object (File)
Wed, Nov 6, 7:26 AM
Unknown Object (File)
Fri, Nov 1, 8:15 PM
Unknown Object (File)
Oct 20 2024, 11:30 AM
Unknown Object (File)
Oct 17 2024, 1:01 PM
Subscribers

Details

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)

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, 12:58 PM
Harbormaster failed remote builds in B27455: Diff 38004!
will requested review of this revision.Mar 11 2024, 1:05 PM

Make sure Android build passes before landing

native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/IntegrityStore.cpp
2 ↗(On Diff #38008)

This is causing your Android pipeline to fail

This revision is now accepted and ready to land.Mar 12 2024, 10:18 AM
will marked an inline comment as done.Mar 18 2024, 9:44 PM
This revision was automatically updated to reflect the committed changes.