-
Notifications
You must be signed in to change notification settings - Fork 358
crypto: Merge inbound Megolm sessions #5865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In order to correctly merge sessions, we need more granular comparisons between two sessions than just "Better" or "Worse", so factor out a method that *just* looks at the ratchet states.
e3c6044 to
5c442d3
Compare
CodSpeed Performance ReportMerging #5865 will not alter performanceComparing Summary
|
andybalaam
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Very excited about this feature.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5865 +/- ##
==========================================
+ Coverage 88.58% 88.59% +0.01%
==========================================
Files 363 363
Lines 102782 102888 +106
Branches 102782 102888 +106
==========================================
+ Hits 91048 91157 +109
+ Misses 7495 7489 -6
- Partials 4239 4242 +3 ☔ View full report in Codecov by Sentry. |
Add a method which can be used to merge a received `InboundGroupSession` into whatever we find in the store.
... with `merge_received_group_session`. `merge_received_group_session` expands the logic of `compare_group_session` to handle the fact that there is more than one axis of "better" or "worse" and we may need to take the best bits of two copies of the session.
Add an integration test that checks that, when we receive a copy of a megolm session directly after having previously received it via history sharing, we get the best bits of both.
f72c06b to
60072b3
Compare
When we receive two copies of the same inbound Megolm session from two sources, merge them together intelligently.
Fixes: #5108, #4698