Page MenuHomePhabricator

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

Authored by will on May 30 2024, 8:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 9:03 AM
Unknown Object (File)
Thu, Dec 19, 6:41 AM
Unknown Object (File)
Thu, Dec 19, 6:40 AM
Unknown Object (File)
Thu, Dec 19, 6:37 AM
Unknown Object (File)
Thu, Dec 19, 4:23 AM
Unknown Object (File)
Wed, Dec 18, 6:35 AM
Unknown Object (File)
Wed, Dec 18, 6:35 AM
Unknown Object (File)
Wed, Dec 18, 6:35 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.