Uh oh!
There was an error while loading. Please reload this page.
Fix up "Test that invites can be rescinded over federation" - #803
Open
erikjohnston wants to merge 2 commits into
Open
Fix up "Test that invites can be rescinded over federation"#803erikjohnston wants to merge 2 commits into
erikjohnston wants to merge 2 commits into
Conversation
MadLittleMods
approved these changes
Sep 9, 2025
| // Check bob is still invited by doing an initial sync | ||
| bob.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(bob.UserID, roomID2)) | ||
| }) |
Contributor
There was a problem hiding this comment.
Suggestion:
t.Run("Non-inviter user cannot rescind invite over federation", func(t*testing.T) {
t.Parallel()
//FirstcreatearoomthatBobisin. Thisissothatlaterwecan//sendamessagetotestthatBobdoesn'tseetherescission.
roomID1 :=alice.MustCreateRoom(t, map[string]interface{}{
"preset": "private_chat",
"invite": []string{bob.UserID},
})
since:=bob.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(bob.UserID, roomID1))
bob.MustJoinRoom(t, roomID1, []spec.ServerName{})
//SecondroomwhichAliceandAlice2join, Alice2invitesBoband//thenAlicekickshim.
roomID2 :=alice.MustCreateRoom(t, map[string]interface{}{
"preset": "private_chat",
"invite": []string{alice2.UserID},
})
alice2.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(alice2.UserID, roomID2))
alice2.MustJoinRoom(t, roomID2, []spec.ServerName{})
//`alice2`invitesbobalice2.MustInviteRoom(t, roomID2, bob.UserID)
bob.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(bob.UserID, roomID2))
//`alice`, nottheoriginalinviter (`alice2`), kicksbob.
alice.MustDo(t, "POST", []string{"_matrix", "client", "v3", "rooms", roomID2, "kick"},
client.WithJSONBody(t, map[string]interface{}{
"user_id": bob.UserID,
"reason": "testing",
}),
)
//Checkbob*doesn't*seetherescission. Wedothisbysendingamessagein//`roomID1` (onthesamehomeserveras`roomID2`) andcheckingthatonceBob//receivesthatnewmessagein`roomID1`hestillhasn'tseentheleavefor`roomID2`.
////Ideally, bobcouldseetherescission, butcurrentlywehavenowaytoauth//thatoverfederation.
eventID :=alice.SendEventSynced(t, roomID1, b.Event{
Type: "m.room.message",
Content: map[string]interface{}{
"body": "1",
"msgtype": "m.text",
},
Sender: alice.UserID,
})
bob.MustSyncUntil(t, client.SyncReq{Since: since}, client.SyncTimelineHasEventID(roomID1, eventID))
//Checkbobisstillinvitedto`roomID2`bydoinganinitialsyncbob.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(bob.UserID, roomID2))
})
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 freeto 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.
Follows on from #797, which I merged Too Soon
c.f. element-hq/synapse#18823