-
Notifications
You must be signed in to change notification settings - Fork 47
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
Fixes/changes for federated invitation tests #494
Conversation
Fixes #2121, test added in matrix-org/complement#494
alice.InviteRoom(t, roomID, bob.UserID) | ||
charlieSince := bob.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(bob.UserID, roomID)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what charlieSince
was here. A typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More or less, probably had a Charlie before and forgot to rename the variable. :)
eventContent := event.Get("content." + field).Str | ||
wantValue := wantValues[eventType] | ||
eventStateKey := event.Get("state_key").Str | ||
|
||
res := cl.MustDoFunc(t, "GET", []string{"_matrix", "client", "v3", "rooms", roomID, "state", eventType, eventStateKey}) | ||
|
||
must.MatchResponse(t, res, match.HTTPResponse{ | ||
JSON: []match.JSON{ | ||
match.JSONKeyEqual(field, eventContent), | ||
match.JSONKeyEqual(field, wantValue), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! good spot
queryParams := url.Values{} | ||
queryParams.Set("format", "event") | ||
bob.MustSyncUntil(t, client.SyncReq{}, client.SyncJoinedTo(bob.UserID, roomID)) | ||
// now get the direct flag from the membership event | ||
res := bob.MustDoFunc(t, "GET", []string{"_matrix", "client", "v3", "rooms", roomID, "state", "m.room.member", bob.UserID}, client.WithQueries(queryParams)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going on with the query parameters? I can't see them mentioned in the spec. It does seem to correspond to this sytest though.
Isn't Bob's membership event visible in the sync result anyway---do we need to make this request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this is apparently unspecced but desired in the spec:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, updated to check the sync response instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes a bug in
verifyState
where we'd compare the expected content with the event itself..Adds a test that
is_direct
is set inunsigned.prev_content
, as clients otherwise might not be able to distinguish between DMs and normal rooms.