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

Fixes/changes for federated invitation tests #494

Merged
merged 6 commits into from
Oct 14, 2022
Merged

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented Oct 7, 2022

Fixes a bug in verifyState where we'd compare the expected content with the event itself..
Adds a test that is_direct is set in unsigned.prev_content, as clients otherwise might not be able to distinguish between DMs and normal rooms.

@S7evinK S7evinK requested review from a team as code owners October 7, 2022 09:03
S7evinK added a commit to matrix-org/dendrite that referenced this pull request Oct 7, 2022
@S7evinK S7evinK changed the title Update FederationRoomsInvite to run sequentially Fixes/changes for federated invitation tests Oct 7, 2022
alice.InviteRoom(t, roomID, bob.UserID)
charlieSince := bob.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(bob.UserID, roomID))
Copy link
Contributor

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?

Copy link
Contributor Author

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. :)

Comment on lines -91 to +94
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),
Copy link
Contributor

Choose a reason for hiding this comment

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

Oops! good spot

Comment on lines 96 to 100
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))
Copy link
Contributor

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?

Copy link
Contributor

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:

matrix-org/synapse#14185 and matrix-org/matrix-spec#1047

Copy link
Contributor Author

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.

Copy link
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

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

Thanks!

@S7evinK S7evinK merged commit f81a91c into main Oct 14, 2022
@S7evinK S7evinK deleted the s7evink/fedinvitetests branch October 14, 2022 18:11
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.

None yet

2 participants