Page MenuHomePhabricator

[web][native] implement encrypting and persisting OutboundP2PMessage's content in the same SQLite transaction as persisting `olm` session
ClosedPublic

Authored by kamil on May 20 2024, 4:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 3:43 PM
Unknown Object (File)
Mon, Dec 23, 3:43 PM
Unknown Object (File)
Mon, Dec 23, 3:43 PM
Unknown Object (File)
Mon, Dec 23, 3:43 PM
Unknown Object (File)
Tue, Nov 26, 9:15 AM
Unknown Object (File)
Tue, Nov 26, 1:16 AM
Unknown Object (File)
Nov 22 2024, 8:57 AM
Unknown Object (File)
Nov 17 2024, 4:52 AM
Subscribers

Details

Summary

To make sure the order is correct also on the sender's side we have to do it in exactly the same SQLite transaction.

A similar approach to decryptSequentialAndPersist.

Depends on D12080

Test Plan

Call this method and make sure data is persisted. Tested end-to-end in D12133.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil edited the test plan for this revision. (Show Details)
kamil published this revision for review.May 21 2024, 1:22 AM
kamil added inline comments.
native/cpp/CommonCpp/NativeModules/CommCoreModule.cpp
1392 ↗(On Diff #40420)

This is some code duplication with CommCoreModule::encrypt but it's not that easy to dedupplicate it

1421–1427 ↗(On Diff #40420)

we have to do it here in C++ to keep this in one transaction. Alternative would be updated table to have two columns: ciphertext_message and ciphertext_message_type but I think this approach is okay too, there are multiple usages of folly::toJson in our codebase

This revision is now accepted and ready to land.May 24 2024, 5:24 AM