Make sure calling /context on an out-of-band membership event doesn't 500#19959
Open
ara4n wants to merge 3 commits into
Open
Make sure calling /context on an out-of-band membership event doesn't 500#19959ara4n wants to merge 3 commits into
ara4n wants to merge 3 commits into
Conversation
An out-of-band membership event (e.g. an invite or knock received over federation) is an outlier with no stream position or state group, so computing surrounding events or state for it fails with 'No state group for unknown or outlier event'. Visibility already permits the user to see their own out-of-band membership events, and clients legitimately fetch them — e.g. to render a push notification for an invite after the server has already joined the user (auto-accepted knock). Return the event with an empty context instead of erroring. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uk8aPxHn3BHCe52L226jdG
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.
An out-of-band membership event (e.g. an invite or knock received over federation) is an outlier with no stream position or state group, so computing surrounding events or state for it fails with 'No state group for unknown or outlier event'.
Visibility already permits the user to see their own out-of-band membership events, and clients legitimately fetch them, e.g. to render a push notification for an invite after the server has already joined the user (auto-accepted knock). Return the event with an empty context instead of erroring.
This is helpful for clients trying to reason about knocks where they might call /context on a state event ID - for instance, Element X iOS's push extension (NSE) calls /context on every event ID it gets, so if you send a state event for autojoining a room you've knocked in, this would have 500'd.
Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.