-
Notifications
You must be signed in to change notification settings - Fork 351
Implement the redecryption logic in the event cache #5746
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
CodSpeed Performance ReportMerging #5746 will not alter performanceComparing Summary
|
54f3b5f to
0f4bbe5
Compare
0f4bbe5 to
9f1aff6
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5746 +/- ##
==========================================
- Coverage 88.61% 88.59% -0.03%
==========================================
Files 361 362 +1
Lines 102160 102604 +444
Branches 102160 102604 +444
==========================================
+ Hits 90532 90903 +371
- Misses 7410 7469 +59
- Partials 4218 4232 +14 ☔ View full report in Codecov by Sentry. |
9f1aff6 to
c21daed
Compare
This allows us to properly calculate the push actions.
This is necessary because both the timeline and the event cache attempt to redecrypt events currently. This will change once only the event cache handles this task.
c21daed to
d7d4730
Compare
Hywan
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.
Wow. That was an impressive set of patches.
How a simple problem gently piles more and more complexity. The resulting code is not complex however, and that's really great. Thank you for the great documentation, including inline documentation!
I've left a couple of feedback, but nothing requiring a huge change.
| let (room_cache, _drop_handles) = self.for_room(room_id).await?; | ||
| let mut state = room_cache.inner.state.write().await; | ||
|
|
||
| let event_ids: Vec<_> = events.iter().map(|(event_id, _)| event_id).collect(); |
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.
Can we compute event_ids if and only if trace! is enabled? Maybe with tracing::enabled!?
Alternatively, I confess it's a bit more logs but, I would put the trace! inside the loop, closer to replace_event_at, because it's where we are really replacing the event. Thoughts?
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.
Can we compute
event_idsif and only iftrace!is enabled? Maybe withtracing::enabled!?
Sadly we can't, as the event IDs are sent out as part of the RedecryptorReport, that's also the reason why we're cloning it in later parts of this patchset:
a2f89e8#diff-5c3b83b7260e87e30c1b6b3bfad8b5be005c31d142b825e75ff0e047680c2923R201
Alternatively, I confess it's a bit more logs but, I would put the
trace!inside the loop, closer toreplace_event_at, because it's where we are really replacing the event. Thoughts?
Hmm, I'm really worried about log spam here. If you're suggesting this because you want to avoid the building of the BTreeSet then I would say that this comment resolved itself since the BTreeSet is necessary for the RedecryptorReport.
|
I'm going to merge this since you approved it. If you feel like there's more to do here please shout and I'll handle it in a separate PR. |
c3fb01d to
9508675
Compare
This is very much a WIP PR. Eventually it will get split into different smaller PRs.
Things that still need to be addressed: