Page MenuHomePhabricator

[sqlite] Implement C++ message store local ops
ClosedPublic

Authored by will on May 30 2024, 8:17 AM.
Tags
None
Referenced Files
F3487001: D12249.id41160.diff
Wed, Dec 18, 6:35 AM
F3487000: D12249.id41158.diff
Wed, Dec 18, 6:35 AM
F3486999: D12249.id41135.diff
Wed, Dec 18, 6:35 AM
F3486998: D12249.id41134.diff
Wed, Dec 18, 6:35 AM
F3486997: D12249.id40778.diff
Wed, Dec 18, 6:35 AM
F3486983: D12249.id.diff
Wed, Dec 18, 6:34 AM
F3486972: D12249.diff
Wed, Dec 18, 6:34 AM
Unknown Object (File)
Wed, Dec 11, 9:33 AM
Subscribers

Details

Summary

Introduces code allowing native to use sqlite message store local ops

Depends on D12248

Test Plan

Tested further in stack. Ran the following code:

let data = await commCoreModule.getClientDBStore();

await commCoreModule.processDBStoreOperations({
  messageStoreOperations: [
  {
    type: 'replace_local_message_info',
    payload: {
      id: '1',
      localMessageInfo: JSON.stringify({
        sendFailed: "1",
      }),
    }
  },
  {
    type: 'replace_local_message_info',
    payload: {
      id: '2',
      localMessageInfo: JSON.stringify({
        sendFailed: "0",
      }),
    }
  },
  {
    type: 'remove_local_message_infos',
    payload: {
      ids: ['1'],
    }
  },
]});

And confirmed correct result

Diff Detail

Repository
rCOMM Comm
Branch
sqlite/message-store-local
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will edited the test plan for this revision. (Show Details)
will edited the test plan for this revision. (Show Details)
will requested review of this revision.May 30 2024, 8:33 AM
tomek added inline comments.
native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/MessageStore.cpp
103–107 ↗(On Diff #40778)

The name of the operation seems inconsistent with the name of a class. Shouldn't all the ops include STORE in their names? But it also seems that we took the same approach for threads - so maybe just keep it?

110–138 ↗(On Diff #40778)

Can we make the newlines consistent for all the ifs?

This revision is now accepted and ready to land.Jun 3 2024, 4:35 AM
native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/MessageStore.cpp
103–107 ↗(On Diff #40778)

Yeah. That makes sense. I believe I was originally following the naming convention of threads. Perhaps if we've decided on this convention, I can modify this diff to include STORE and include a diff that renames our thread operations?

native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/MessageStore.cpp
103–107 ↗(On Diff #40778)

That would be great!

native/cpp/CommonCpp/NativeModules/PersistentStorageUtilities/DataStores/MessageStore.cpp
103–107 ↗(On Diff #40778)
This revision was landed with ongoing or failed builds.Jun 10 2024, 5:11 AM
This revision was automatically updated to reflect the committed changes.