Page MenuHomePhabricator

Refactor olm-session-updater to enable to conditionally skip database content update
ClosedPublic

Authored by marcin on Jul 21 2023, 2:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 12:00 PM
Unknown Object (File)
Sat, May 4, 12:00 PM
Unknown Object (File)
Sat, May 4, 12:00 PM
Unknown Object (File)
Tue, Apr 30, 3:41 AM
Unknown Object (File)
Sat, Apr 27, 7:16 PM
Unknown Object (File)
Thu, Apr 25, 3:37 AM
Unknown Object (File)
Mon, Apr 22, 12:42 AM
Unknown Object (File)
Sun, Apr 21, 11:50 PM
Subscribers

Details

Summary

This differential refactors olm-session-updater so that oit takes optional lambda that tells, based on post encryption content, whether session state at the database should be updated. This will come in handy in a case when we are not sure
whether we will send encrypted data to somebody until we see encrypted content. An example will is teh case of large notifications. Before we decide whether we want to send full notification paylaod or blob ash with encryption key we must encrypt
notification. But if we encrypt notification, then decide to upload it to blob service and send to the client encrypted AES key with blob hash, the client will have to skip one olm key and will keep skipped key forever. However with the changes
introduced in this diff we can easily pass lambda that tells olm-session-updater not to update olm session if notification after encryption is larger than limits. This way we will encrypt AES key and blob hash with the same olm key that we initially
used to encrypt original notification and the client won't have to skip any key.

Test Plan

Currently this feature is not used so the test plan is to check that encrypted notifications work properly without any issues

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jul 25 2023, 5:32 AM