Repository navigation
receipts: check the reader and thread of a federated receipt - #725
Open
basnijholt wants to merge 1 commit into
Open
basnijholt wants to merge 1 commit into
basnijholt wants to merge 1 commit into
Conversation
Check the membership of the reader, not just their server, and resolve a thread root on the room timeline. Share the room-scoped position lookup with private read markers. The receipt position itself need not be available yet: an EDU can arrive before the event it acknowledges. 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?
A federated
m.receiptEDU was accepted when the reader's server matched the sending server. The reader's membership in the room was not checked, and a thread receipt's thread root was not resolved on the room's timeline, so receipts could be recorded for users not in the room.The reader must now be a member of the room, and a thread root must be an event of that room's timeline. The room-scoped lookup is shared with private read markers. The receipt's position itself does not need to be known yet, since an EDU can arrive before the event it acknowledges.
Found through MindRoom. Fork changes: mindroom-ai/mindroom-tuwunel#66 and mindroom-ai/mindroom-tuwunel#101.
Tests:
rooms::read_receipt::tests::federated_receipts_check_the_reader_and_thread_not_the_position: a receipt from an ineligible reader is rejected, a thread root from another room is rejected, and a receipt for a not-yet-known position is accepted. It fails without the fix (the ineligible reader is accepted).Validation:
nightly-2026-11-03):cargo fmt --all -- --checkpasses.cargo clippy --offline --locked -p tuwunel_service -p tuwunel_api_client -p tuwunel_api_federation --all-targets --all-features -- -D warningspasses.cargo testof those packages' libraries: 1,018 passed;cargo test -p tuwunel --test private_receipt_room --test receipt_replay --test thread_root_receiptpass.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.)