Skip to content
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

UTD hook: stop re-reporting of UTDs on app relaunch #3519

Merged
merged 13 commits into from
Jun 10, 2024
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jun 6, 2024

This is a fix to #3374, and a re-do of #3490.

The principle remains to use a Bloom filter to keep track of which events we have already reported to the parent UTD hook. We load the data from database on startup; we now flush it out immediately on every update.

richvdh added 8 commits June 6, 2024 16:33
We'll need this for persisting the data to storage.
We're going to add some more stuff here, and it's going to be async, so
a separate function will be helpful.
This isn't all that much use at the moment: we need to add persistence to the
store.

To limit the growth rate of reported_utds, use a bloom filter instead of a set.
@richvdh richvdh requested a review from a team as a code owner June 6, 2024 15:36
@richvdh richvdh requested review from bnjbvr and removed request for a team June 6, 2024 15:36
@richvdh richvdh force-pushed the rav/deduplicate_utds2 branch from 515a8c8 to 21bc95e Compare June 6, 2024 15:46
Copy link

codecov bot commented Jun 6, 2024

Codecov Report

Attention: Patch coverage is 97.56098% with 2 lines in your changes missing coverage. Please review.

Project coverage is 83.81%. Comparing base (3f272a7) to head (1b7f05f).
Report is 2 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk-base/src/store/memory_store.rs 83.33% 1 Missing ⚠️
crates/matrix-sdk-ui/src/unable_to_decrypt_hook.rs 97.14% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3519      +/-   ##
==========================================
+ Coverage   83.79%   83.81%   +0.01%     
==========================================
  Files         254      254              
  Lines       25723    25765      +42     
==========================================
+ Hits        21555    21595      +40     
- Misses       4168     4170       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@richvdh richvdh force-pushed the rav/deduplicate_utds2 branch from 21bc95e to 1b7f05f Compare June 6, 2024 16:01
@@ -9,7 +9,14 @@ Breaking changes:
Bug fixes:

- `UtdHookManager` no longer re-reports UTD events as late decryptions.
([#3840](https://github.com/matrix-org/matrix-rust-sdk/pull/3840))
([#3480](https://github.com/matrix-org/matrix-rust-sdk/pull/3480))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixing a typo while I'm here 😇

@BillCarsonFr
Copy link
Member

FYI I tested this PR with Element X. No source breaking changes.

As required I tested logout, and it's not crashing.

Also after puting the app in background, killing and re-open it it's not reporting again Error events for UTD

image

Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice commits, lgtm, thanks

@richvdh richvdh merged commit 1510f87 into main Jun 10, 2024
38 checks passed
@richvdh richvdh deleted the rav/deduplicate_utds2 branch June 10, 2024 17:56
@richvdh richvdh linked an issue Jun 12, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Posthog: stop double reporting UTD events when app is relaunched
3 participants