HomePhabricator
Diffusion Comm 9567929ea151

[sqlite] Implement C++ code for native to get sqlite thread activity entries

Description

[sqlite] Implement C++ code for native to get sqlite thread activity entries

Summary:
This implements C++ code to allow native to get sqlite thread activity entries

Depends on D11584

Test Plan:
Ran the following code and console logged the thread activity store successfully:

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

await commCoreModule.processThreadActivityStoreOperations([
  {
    type: 'replace_thread_activity_entry',
    payload: {
      id: 'test_A_id',
      threadActivityStoreEntry: JSON.stringify({
        lastNavigatedTo: 1,
        lastPruned: 2,
      }),
    },
  },
  {
    type: 'remove_all_thread_activity_entries',
  },
  {
    type: 'replace_thread_activity_entry',
    payload: {
      id: 'test_B_id',
      threadActivityStoreEntry: JSON.stringify({
        lastNavigatedTo: 3,
        lastPruned: 4,
      }),
    },
  },
  {
    type: 'replace_thread_activity_entry',
    payload: {
      id: 'test_C_id',
      threadActivityStoreEntry: JSON.stringify({
        lastNavigatedTo: 5,
        lastPruned: 6,
      }),
    },
  },
  {
    type: 'remove_thread_activity_entries',
    payload: {
      ids: ['test_B_id'],
    },
  },
]);

data = await commCoreModule.getClientDBStore();
console.log(data.threadActivityEntries);

Screenshot 2024-04-10 at 1.55.43 AM.png (156×826 px, 22 KB)

Reviewers: atul, kamil

Reviewed By: kamil

Subscribers: ashoat, tomek

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

Details