Page MenuHomePhabricator

[sqlite] implement processing integrity store ops on worker
ClosedPublic

Authored by will on Mar 11 2024, 7:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 5:37 PM
Unknown Object (File)
Apr 4 2024, 10:54 AM
Unknown Object (File)
Apr 3 2024, 2:18 AM
Unknown Object (File)
Apr 3 2024, 2:18 AM
Unknown Object (File)
Mar 22 2024, 10:11 PM
Unknown Object (File)
Mar 21 2024, 4:01 PM
Unknown Object (File)
Mar 18 2024, 10:43 PM
Unknown Object (File)
Mar 18 2024, 9:03 PM
Subscribers

Details

Summary

Introduces integrity store ops to web worker

Depends on D11307

Test Plan

Ran the following code on web and confirmed results:

await databaseModule.schedule({
  type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
  storeOperations: {
    integrityStoreOperations: [
      {
        type: 'remove_all_integrity_thread_hashes',
      },
    ],
  },
});

console.log(data?.store?.integrityThreadHashes);

const TEST_THREAD_HASHES_1 = [{ id: '256|2202182', threadHash: 2304934 }];

const TEST_THREAD_HASHES_2 = [
  { 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 databaseModule.schedule({
  type: workerRequestMessageTypes.PROCESS_STORE_OPERATIONS,
  storeOperations: {
    integrityStoreOperations: [
      {
        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 databaseModule.schedule({
  type: workerRequestMessageTypes.GET_CLIENT_STORE,
});

console.log(data?.store?.integrityThreadHashes);

image.png (316×1 px, 66 KB)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

will edited the test plan for this revision. (Show Details)
Harbormaster returned this revision to the author for changes because remote builds failed.Mar 11 2024, 7:58 PM
Harbormaster failed remote builds in B27458: Diff 38007!
will published this revision for review.Mar 11 2024, 10:20 PM
This revision is now accepted and ready to land.Mar 12 2024, 10:20 AM