Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fix error handling for missing auth_event #3960

Merged
merged 3 commits into from Oct 2, 2018

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Sep 26, 2018

When we were authorizing an event, if there was no m.room.create in its
auth_events, we would raise a SynapseError with a cryptic message, which
then meant that we would bail out of processing any incoming events, rather
than storing a rejection for the faulty event and moving on.

We should treat the absent event the same as any other auth failure, by
raising an AuthError, so that the event is marked as rejected.

When we were authorizing an event, if there was no `m.room.create` in its
auth_events, we would raise a SynapseError with a cryptic message, which then
meant that we would bail out of processing any incoming events, rather than
storing a rejection for the faulty event and moving on.

We should treat the absent event the same as any other auth failure, by
raising an AuthError, so that the event is marked as rejected.
@richvdh richvdh requested a review from a team September 26, 2018 13:41
@hawkowl
Copy link
Contributor

hawkowl commented Sep 26, 2018

@richvdh do we have tests for this behaviour?

@richvdh
Copy link
Member Author

richvdh commented Sep 26, 2018

Not really, I'm afraid. Right now it's hard to test this functionality, because other bugs (notably #3923) stop the relevant bit of code even being reached.

We could hold off on this PR for now, and wait for the fix to #3923, and then make a sytest that checks this properly.

@richvdh richvdh self-assigned this Sep 27, 2018
@richvdh richvdh moved this from To Do to In Progress: Operational/bug fixes in Superceded by https://github.com/orgs/matrix-org/projects/8 Sep 28, 2018
richvdh added a commit to matrix-org/sytest that referenced this pull request Oct 1, 2018
richvdh added a commit to matrix-org/sytest that referenced this pull request Oct 1, 2018
@richvdh
Copy link
Member Author

richvdh commented Oct 1, 2018

there is kind-of a test for this now in matrix-org/sytest#499.

@richvdh richvdh removed their assignment Oct 1, 2018
richvdh added a commit to matrix-org/sytest that referenced this pull request Oct 1, 2018
richvdh added a commit to matrix-org/sytest that referenced this pull request Oct 1, 2018
@richvdh richvdh self-assigned this Oct 1, 2018
@richvdh richvdh merged commit 2b8d28b into develop Oct 2, 2018
@richvdh richvdh deleted the rav/fix_missing_create_event_error branch October 2, 2018 12:58
@richvdh richvdh moved this from In Progress: Operational/bug fixes to Done - Operations in Superceded by https://github.com/orgs/matrix-org/projects/8 Oct 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants