Skip to content

Conversation

@erikjohnston
Copy link
Member

@kegsay
Copy link
Member

kegsay commented Aug 15, 2025

Very sensible, I'm surprised we didn't!

"invite": []string{bob.UserID},
})
bob.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(bob.UserID, roomID))
alice.MustDo(t, "POST", []string{"_matrix", "client", "v3", "rooms", roomID, "kick"},
Copy link
Collaborator

@MadLittleMods MadLittleMods Aug 26, 2025

Choose a reason for hiding this comment

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

It would be good to have a test where someone else rescinds the invite (someone different than the inviter)

Also a test for someone else from another server in the room

Copy link
Collaborator

Choose a reason for hiding this comment

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

Test was added for the first case but not the second for someone else from another server in the room

bob.MustSyncUntil(t, client.SyncReq{Filter: includeLeaveSyncFilter}, client.SyncLeftFrom(bob.UserID, roomID))
})

t.Run("Non-invitee user cannot rescind invite over federation", func(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
t.Run("Non-invitee user cannot rescind invite over federation", func(t *testing.T) {
t.Run("Non-inviter user cannot rescind invite over federation", func(t *testing.T) {

Comment on lines +195 to +196
// Alice, not the original inviter, kicks bob. This does not result
// in bob seeing the rescission.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should comment that it would be fine for bob to see the rescission but they have no way to auth it because of X so they can't take it into account

"invite": []string{bob.UserID},
})
bob.MustSyncUntil(t, client.SyncReq{}, client.SyncInvitedTo(bob.UserID, roomID))
alice.MustDo(t, "POST", []string{"_matrix", "client", "v3", "rooms", roomID, "kick"},
Copy link
Collaborator

Choose a reason for hiding this comment

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

Test was added for the first case but not the second for someone else from another server in the room

erikjohnston added a commit to element-hq/synapse that referenced this pull request Sep 8, 2025
We should send events that rescind invites over federation.

Similarly, we should handle receiving such events. Unfortunately, the
protocol doesn't make it possible to fully auth such events, and so we
can only handle the case where the original inviter rescinded the invite
(rather than a room admin).

Complement test: matrix-org/complement#797
@erikjohnston erikjohnston merged commit fd97e2b into main Sep 8, 2025
4 checks passed
@erikjohnston erikjohnston deleted the erikj/revoke_invite_fed branch September 8, 2025 09:56
@erikjohnston
Copy link
Member Author

Oh blast I thought I had dealt with all the reviews.

I'll do them in another PR!

itsoyou pushed a commit to famedly/synapse that referenced this pull request Oct 13, 2025
We should send events that rescind invites over federation.

Similarly, we should handle receiving such events. Unfortunately, the
protocol doesn't make it possible to fully auth such events, and so we
can only handle the case where the original inviter rescinded the invite
(rather than a room admin).

Complement test: matrix-org/complement#797
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.

4 participants