0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-06-30 10:18:20 +02:00
dendrite/syncapi/streams
Tak Wai Wong 75a508cc27
Fix issue where a member is forced to leave a room when the invite is marked deleted (#2839)
Proposed fix for issue:
https://github.com/matrix-org/dendrite/issues/2838

Suppose bob received invites to spaceA and spaceB.
When Bob joins spaceA, we add an OutputEvent event to retire the invite.
This sets the invite to "deleted" in the database. This makes sense.

The bug is in stream_invites.go. Triggered when bob received a new
invite for spaceB, and does a client sync.

In the block (line 76)
`for roomID := range retiredInvites

   if _, ok := req.Response.Rooms.Invite[roomID]; ok {
	continue
   }

   if _, ok := req.Response.Rooms.Join[roomID]; ok {
	continue
  }
...
` 

Bob is not in either maps even though he had just accepted the invite
for spaceA. Consequently, the spaceA invite is treated as a retired
invite, and a membership Leave event is generated. What bob sees is that
after accepting the invite to spaceB, he lose access to spaceA.


### Pull Request Checklist

<!-- Please read
https://matrix-org.github.io/dendrite/development/contributing before
submitting your pull request -->

* [ ] I have added tests for PR _or_ I have justified why this PR
doesn't need tests.
* [x ] Pull request includes a [sign off below using a legally
identifiable
name](https://matrix-org.github.io/dendrite/development/contributing#sign-off)
_or_ I have already signed off privately

Signed-off-by: `Tak Wai Wong <tak@hntlabs.com>`

Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
2022-11-02 10:02:23 +00:00
..
stream_accountdata.go Remove empty fields from /sync response (#2755) 2022-10-05 13:47:13 +01:00
stream_devicelist.go Modify sync transaction behaviour (#2758) 2022-10-03 11:38:20 +01:00
stream_invite.go Fix issue where a member is forced to leave a room when the invite is marked deleted (#2839) 2022-11-02 10:02:23 +00:00
stream_notificationdata.go Always add UnreadNotifications to joined room reponses (#2793) 2022-10-14 10:38:12 +02:00
stream_pdu.go Don't limit "state" (#2849) 2022-11-02 09:34:19 +00:00
stream_presence.go Get state deltas without filters (#2810) 2022-10-19 14:05:39 +02:00
stream_receipt.go Private read receipts (#2789) 2022-10-11 12:27:21 +01:00
stream_sendtodevice.go Modify sync transaction behaviour (#2758) 2022-10-03 11:38:20 +01:00
stream_typing.go Remove empty fields from /sync response (#2755) 2022-10-05 13:47:13 +01:00
streamprovider.go Transactional isolation for /sync (#2745) 2022-09-30 12:48:10 +01:00
streams.go Fix broken /sync due to transaction error 2022-09-30 16:07:18 +01:00
template_stream.go Transactional isolation for /sync (#2745) 2022-09-30 12:48:10 +01:00