Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for events with incorrect auth during faster join #433

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Aug 4, 2022

A couple more faster-joins tests: one for an event that should have been rejected but was not, and one with an event that should have been accepted but was rejected.

Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

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

Looks reasonable!

It's upsetting that state during a partial join works like this. I suspect we don't let incremental syncing clients know when state becomes unrejected. And we have no way of "deleting" state in incremental sync.

Comment on lines +891 to +900
// the bad state event should now *not* be visible
must.MatchResponse(t,
alice.DoFunc(t, "GET", []string{"_matrix", "client", "r0", "rooms", serverRoom.RoomID, "event", badStateEvent.EventID()}),
match.HTTPResponse{
StatusCode: 404,
JSON: []match.JSON{
match.JSONKeyEqual("errcode", "M_NOT_FOUND"),
},
},
)
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this work?
Does the bad state event initially appear in the sync timeline, then disappear for future syncs?

Copy link
Member Author

Choose a reason for hiding this comment

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

Does the bad state event initially appear in the sync timeline, then disappear for future syncs?

yes, basically. A client which calls /sync during the resync will see the bad state event (and, as you note elsewhere, we have no way of then telling it via subesequent incremental syncs that it was a mistake).

A client which does a sync after the resync will never see the bad state event, because we filter out rejected events from /sync results.

@squahtx
Copy link
Contributor

squahtx commented Aug 9, 2022

we don't let incremental syncing clients know when state becomes unrejected. And we have no way of "deleting" state in incremental sync.

actually that's the same as matrix-org/matrix-spec#1209

@richvdh richvdh merged commit 25c945f into main Aug 11, 2022
@richvdh richvdh deleted the rav/bad_events_in_faster_join branch August 11, 2022 19:43
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.

3 participants