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

feat(utd_hook): Report historical expected UTD with new reason #4275

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented Nov 18, 2024

Fixes element-hq/element-meta#2581

Detect and report expected historical UTDs as such. Must be integrated by clients and reported with this code in Analytics.

To determine if an event is device historical (i.e sent before the current login existed) we use an heuristic based on the event origin_server_ts and the device creation local timestamp.

  • Public API changes documented in changelogs (optional)

Signed-off-by:

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.05%. Comparing base (7a45488) to head (a0c86d9).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4275      +/-   ##
==========================================
- Coverage   85.05%   85.05%   -0.01%     
==========================================
  Files         276      276              
  Lines       30371    30382      +11     
==========================================
+ Hits        25833    25842       +9     
- Misses       4538     4540       +2     

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

@BillCarsonFr BillCarsonFr marked this pull request as ready for review November 18, 2024 09:45
@BillCarsonFr BillCarsonFr requested review from a team as code owners November 18, 2024 09:45
@BillCarsonFr BillCarsonFr requested review from Hywan and richvdh and removed request for a team November 18, 2024 09:45
@BillCarsonFr BillCarsonFr marked this pull request as draft November 18, 2024 16:56
@BillCarsonFr BillCarsonFr force-pushed the valere/utd_hook_historical_message branch 3 times, most recently from 23fa445 to 31f91d9 Compare November 20, 2024 08:45
@BillCarsonFr BillCarsonFr marked this pull request as ready for review November 20, 2024 09:06
@Hywan Hywan removed their request for review November 25, 2024 09:36
@BillCarsonFr BillCarsonFr requested a review from richvdh November 25, 2024 13:42
crates/matrix-sdk/src/room/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-ui/src/timeline/traits.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-common/src/types.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-common/src/types.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-common/src/types.rs Outdated Show resolved Hide resolved
crates/matrix-sdk/src/room/mod.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/events/utd_cause.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-ui/src/timeline/event_handler.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-ui/src/timeline/event_handler.rs Outdated Show resolved Hide resolved
@BillCarsonFr BillCarsonFr requested a review from richvdh November 27, 2024 09:48
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

A few nits, but nothing major now. Thanks!

Please remember to rebase your commits so that there is a sensible history before you merge.

crates/matrix-sdk-crypto/src/types/events/utd_cause.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/events/utd_cause.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/events/utd_cause.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/events/utd_cause.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/events/utd_cause.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/events/utd_cause.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-crypto/src/types/events/utd_cause.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-ui/src/timeline/event_handler.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-ui/src/timeline/event_handler.rs Outdated Show resolved Hide resolved
crates/matrix-sdk-ui/src/timeline/event_handler.rs Outdated Show resolved Hide resolved
This PR introduces a new variant to `UtdCause` specifically for device-historical messages (`HistoricalMessage`). These messages cannot be decrypted if key storage is inaccessible. Applications can leverage this new variant to provide more informative error messages to users.
@BillCarsonFr BillCarsonFr force-pushed the valere/utd_hook_historical_message branch from 6c62de7 to a0c86d9 Compare November 27, 2024 17:09
@BillCarsonFr BillCarsonFr merged commit 3369903 into main Nov 27, 2024
40 checks passed
@BillCarsonFr BillCarsonFr deleted the valere/utd_hook_historical_message branch November 27, 2024 17:23
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.

EX: report expected device-historical UTDs to posthog using the new code HistoricalMessage
2 participants