HomePhabricator
Diffusion Comm d30fd946950c

[sqlite] Implement C++ for native to get all aux user infos

Description

[sqlite] Implement C++ for native to get all aux user infos

Summary:
This allows native to get all aux user infos from sqlite aux user store

Depends on D11509

Test Plan:
Ran the following code and confirmed results by getting all aux user infos:

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

  await commCoreModule.processAuxUserStoreOperations([
    {
      type: 'remove_all_aux_user_infos',
    },
  ]);

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

  await commCoreModule.processAuxUserStoreOperations([
    {
      type: 'replace_aux_user_info',
      payload: {
        id: 'test_aux_user_A',
        auxUserInfo: JSON.stringify({ fid: 'test_fid_of_user_A' }),
      },
    },
    {
      type: 'remove_all_aux_user_infos',
    },
    {
      type: 'replace_aux_user_info',
      payload: {
        id: 'test_aux_user_B',
        auxUserInfo: JSON.stringify({ fid: 'test_fid_of_user_B' }),
      },
    },
    {
      type: 'replace_aux_user_info',
      payload: {
        id: 'test_aux_user_C',
        auxUserInfo: JSON.stringify({ fid: 'test_fid_of_user_C' }),
      },
    },
    {
      type: 'remove_aux_user_infos',
      payload: {
        ids: ['test_aux_user_C'],
      },
    },
  ]);

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

Screenshot 2024-04-01 at 2.04.16 AM.png (60×585 px, 8 KB)

Reviewers: ginsu, kamil, atul

Reviewed By: atul

Subscribers: ashoat, tomek

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

Details

Provenance
willAuthored on Mar 29 2024, 1:58 PM
Reviewer
atul
Differential Revision
D11510: [sqlite] Implement C++ for native to get all aux user infos
Parents
rCOMM5a0daf51e0c7: [sqlite] implement C++ aux user store ops
Branches
Unknown
Tags
Unknown