Skip to content

fix(sdk): Do not update the LatestEventValue if its event ID matches the previous value - #6396

Merged
Hywan merged 4 commits into
matrix-org:mainfrom
Hywan:fix-issue-6381
Apr 14, 2026
Merged

Hywan merged 4 commits into
matrix-org:mainfrom
Hywan:fix-issue-6381

Conversation

@Hywan

@Hywan Hywan commented Apr 1, 2026 •

Copy link
Copy Markdown
Member

This patch updates the logic to update a LatestEventValue. We still can't compare two LatestEventValue because the type doesn't implement PartialEq. However, we can use the EventId in some case.

It fixes #6381.


  • I've documented the public API Changes in the appropriate CHANGELOG.md files.
  • This PR was made with the help of AI.

Comment thread crates/matrix-sdk/src/latest_events/latest_event/mod.rs
@codspeed

codspeed Bot commented Apr 1, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 40.62%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 1 regressed benchmark
✅ 49 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation Restore session [memory store] 165.7 ms 279 ms -40.62%

Comparing Hywan:fix-issue-6381 (6214dd8) with main (9c28ee7)

Open in CodSpeed

@codecov

codecov Bot commented Apr 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.11321% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.82%. Comparing base (9c28ee7) to head (6214dd8).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...s/matrix-sdk/src/latest_events/latest_event/mod.rs 98.11% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6396      +/-   ##
==========================================
- Coverage   89.83%   89.82%   -0.01%     
==========================================
  Files         378      378              
  Lines      104214   104314     +100     
  Branches   104214   104314     +100     
==========================================
+ Hits        93622    93702      +80     
- Misses       7000     7016      +16     
- Partials     3592     3596       +4     

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

Hywan added a commit to Hywan/matrix-rust-sdk that referenced this pull request Apr 1, 2026
@Hywan
Hywan marked this pull request as ready for review April 1, 2026 13:28
@Hywan
Hywan requested a review from a team as a code owner April 1, 2026 13:28
@Hywan
Hywan requested review from poljar and removed request for a team April 1, 2026 13:28
@Hywan Hywan changed the title fix(sdk): Do not update the LatestEventValue is its event ID matches the previous value fix(sdk): Do not update the LatestEventValue if its event ID matches the previous value Apr 1, 2026
Hywan added a commit to Hywan/matrix-rust-sdk that referenced this pull request Apr 1, 2026
@poljar

poljar commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Does this need two reviewers or what's going on?

@Hywan

Hywan commented Apr 2, 2026

Copy link
Copy Markdown
Member Author

@poljar GitHub picked you once the PR was ready, but @bnjbvr also reviewed it while it was a draft.

Hywan added a commit to Hywan/matrix-rust-sdk that referenced this pull request Apr 2, 2026
@Hywan

Hywan commented Apr 2, 2026

Copy link
Copy Markdown
Member Author

(have rebased to resolve the conflict)

@poljar poljar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small tweak to the changelog entry required, looks good otherwise.

Comment thread crates/matrix-sdk/CHANGELOG.md Outdated
Hywan added 4 commits April 14, 2026 12:34
…s the previous value.

This patch updates the logic to update a `LatestEventValue`. We still
can't compare two `LatestEventValue` because the type doesn't implement
`PartialEq`. However, we can use the `EventId` in some case.

It fixes matrix-org#6381.
@Hywan
Hywan enabled auto-merge (rebase) April 14, 2026 10:35
@Hywan
Hywan merged commit 936f173 into matrix-org:main Apr 14, 2026
51 checks passed
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.

Latest event sends updates even when the latest event item hasn't changed

3 participants