Repository navigation
state_accessor: bound retained history by the end of the last join - #731
Open
basnijholt wants to merge 2 commits into
Open
basnijholt wants to merge 2 commits into
basnijholt wants to merge 2 commits into
Conversation
A recorded leave does not mean that the user joined the room. Keep only the requester’s membership in left room state unless the user once joined or the room is world-readable. Apply the check to events copied from a zero-limit timeline as well as to the state snapshot. Assisted-by: MindRoom DevAgent:openai/gpt-6.2-astra <https://github.com/mindroom-ai/mindroom>
The leave row is a notification cursor. Locate the leave or ban that ended the last join by walking membership predecessors and use it for both shared history and the departure snapshot. Bound the walk and keep the departure notice, not later room state, on a lookup failure. Assisted-by: MindRoom DevAgent:openai/gpt-6.2-astra <https://github.com/mindroom-ai/mindroom>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Based on #729; only the second commit is new here.
A former member's history and left-room state were bounded by the leave row, which is a notification cursor, not the end of their membership. A later knock and its withdrawal write a newer leave row, so a user who had left could widen the room history and state they were served up to the withdrawal.
The leave or ban that ended the user's last join is now found by walking membership predecessors, with a bounded walk, and used for both shared history and the departure snapshot. If the departure cannot be established, the leave notification is kept without later room state or history. No separate
sinceclamp is needed.Found through MindRoom. Fork changes: mindroom-ai/mindroom-tuwunel#59, #81, #125 and #126.
Tests:
rooms::state_accessor::user_can::tests(departure lookup,missing_snapshot_keeps_the_notification) and cases insrc/main/tests/sync_v5_rescinded_invite.rs. They fail on the parent commit (position 8, the notification, instead of the departure at 4).Validation:
nightly-2026-11-03):cargo fmt --all -- --checkpasses.cargo clippy --offline --lockedon the touched crates with--all-targets --all-features -- -D warningspasses.cargo test -p tuwunel_service --lib: 1,007 passed, plus three related integration tests.Checklist
cargo fmtand satisfies clippy and rustc lints; any allowed lint is justified by an obvious reason or a comment.src/core/config/mod.rsdoc comments and the regeneratedtuwunel-example.tomlis committed. (No config changes.)docs/. (No user-facing docs change.)