Skip to content

feat(sdk): Only share history if room history visibility is shared#6275

Merged
kaylendog merged 6 commits intomainfrom
kaylendog/history-sharing/respect-visibility
Mar 12, 2026
Merged

feat(sdk): Only share history if room history visibility is shared#6275
kaylendog merged 6 commits intomainfrom
kaylendog/history-sharing/respect-visibility

Conversation

@kaylendog
Copy link
Copy Markdown
Contributor

@kaylendog kaylendog commented Mar 11, 2026

This PR resolves the case where Alice and Bob share the keys to history unexpectedly by only sharing key bundles if the current room history is shared or world_readable.

Part of element-hq/element-meta#3101, which includes a full scenario this PR combats.

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

Signed-off-by: Skye Elliot actuallyori@gmail.com

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
This commit additionally flips the order of a few assertions to
meet developer expectations, i.e. errors are reported as diffs
from expected.

Signed-off-by: Skye Elliot <actuallyori@gmail.com>
@kaylendog kaylendog self-assigned this Mar 11, 2026
@kaylendog kaylendog force-pushed the kaylendog/history-sharing/respect-visibility branch from 7bbdca7 to d58873f Compare March 11, 2026 14:37
Comment thread crates/matrix-sdk/src/room/shared_room_history.rs Outdated
@kaylendog kaylendog marked this pull request as ready for review March 11, 2026 14:41
@kaylendog kaylendog requested a review from a team as a code owner March 11, 2026 14:41
@kaylendog kaylendog requested review from stefanceriu and removed request for a team March 11, 2026 14:41
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Mar 11, 2026

Merging this PR will not alter performance

✅ 50 untouched benchmarks


Comparing kaylendog/history-sharing/respect-visibility (ea74fda) with main (791f4bc)

Open in CodSpeed

This isn't strictly necessary, but the lack of these events was
causing spurious CI timeouts when tested with the logic that
assumed a stricter history visibility than the spec required.
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.93%. Comparing base (791f4bc) to head (ea74fda).
⚠️ Report is 29 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6275      +/-   ##
==========================================
+ Coverage   89.91%   89.93%   +0.01%     
==========================================
  Files         372      372              
  Lines      102538   102538              
  Branches   102538   102538              
==========================================
+ Hits        92199    92215      +16     
+ Misses       6785     6771      -14     
+ Partials     3554     3552       -2     

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

Copy link
Copy Markdown
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

Makes sense to me 👍

@kaylendog kaylendog merged commit b6c4bca into main Mar 12, 2026
53 checks passed
@kaylendog kaylendog deleted the kaylendog/history-sharing/respect-visibility branch March 12, 2026 14:55
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.

2 participants