Page MenuHomePhabricator

[sqlite] implement C++ community store ops
ClosedPublic

Authored by ginsu on Feb 23 2024, 12:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 27, 11:27 AM
Unknown Object (File)
Wed, Nov 27, 9:45 AM
Unknown Object (File)
Mon, Nov 11, 4:31 PM
Unknown Object (File)
Wed, Nov 6, 3:24 PM
Unknown Object (File)
Oct 15 2024, 6:49 AM
Unknown Object (File)
Oct 15 2024, 6:49 AM
Unknown Object (File)
Oct 15 2024, 6:49 AM
Unknown Object (File)
Oct 15 2024, 6:49 AM
Subscribers

Details

Summary

Introduced all the necessary code for native ops for modifying the community store

Linear task: https://linear.app/comm/issue/ENG-6532/implement-c-community-store-ops

Depends on D11151

Test Plan

Ran the following code:

const TEST_COMMUNITY_1: CommunityInfo = {
  enabledApps: {
    calendar: false,
    wiki: false,
    tasks: true,
    files: true,
  },
};

const TEST_COMMUNITY_2: CommunityInfo = {
  enabledApps: {
    calendar: true,
    wiki: false,
    tasks: false,
    files: false,
  },
};

await commCoreModule.processCommunityStoreOperations([
  {
    type: 'replace_community',
    payload: {
      id: '1',
      communityInfo: TEST_COMMUNITY_1,
    },
  },
  {
    type: 'replace_community',
    payload: {
      id: '2',
      communityInfo: TEST_COMMUNITY_2,
    },
  },
]);

const community2Updated: CommunityInfo = {
  enabledApps: {
    calendar: true,
    wiki: true,
    tasks: true,
    files: true,
  },
};

await commCoreModule.processCommunityStoreOperations([
  {
    type: 'replace_community',
    payload: {
      id: '2',
      communityInfo: community2Updated,
    },
  },
]);

await commCoreModule.processCommunityStoreOperations([
  {
    type: 'remove_communities',
    payload: {
      ids: ['1'],
    },
  },
]);

await commCoreModule.processCommunityStoreOperations([
  {
    type: 'remove_all_communities',
  },
]);

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

ginsu added reviewers: atul, inka, kamil.
ginsu edited the test plan for this revision. (Show Details)
kamil requested changes to this revision.Feb 23 2024, 6:25 AM

Looks correct!

One question about testing - processCommunityStoreOperations is not called anywhere so I don't think it caused any changes in SQLite:

  1. Your stack is not fully published, could you then publish it and link where ops are actually scheduled on DB?
  2. As an alternative you could test it using direct commCoreModule calls like here: D10776
This revision now requires changes to proceed.Feb 23 2024, 6:25 AM

Actually, looking at D11153 I see it was tested so unblocking but it would be great if you could respond and update the test plan

This revision is now accepted and ready to land.Feb 23 2024, 6:27 AM
ginsu edited the test plan for this revision. (Show Details)

it would be great if you could respond and update the test plan

Test plan has been updated

This revision was automatically updated to reflect the committed changes.