This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix that user cannot /forget
rooms after the last member has left
#13546
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
06be1aa
Fix that user cannot `/forget` rooms after the last member has left
dklimpel efd0e19
newsfile
dklimpel 0a19083
Merge remote-tracking branch 'synapse/develop' into fix_forget
dklimpel aa302cf
update tests
dklimpel 847d8ba
Remove test `test_rejoin_forgotten_by_server`
dklimpel a2528f2
Remove import `event_injection`
dklimpel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix bug that user cannot `/forget` rooms after the last member has left the room. |
This file contains 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
This file contains 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
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.
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.
This test is failing
I am not sure if this is a bug in Synapse or a wrong test.
The error occures there:
synapse/synapse/handlers/room_member.py
Lines 1668 to 1689 in 0a4efbc
Actually, this is not a fault of forgetting rooms, rather of leaving and joining rooms.
Perhaps related to:
How to deal with it?
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.
Synapse doesn't know how to rejoin the user to
self.room_id
becauseself.room_id
after it's been forgottenThis one might be better handled with a complement test, so that you genuinely do have a remote homeserver; otherwise I think you'd have to do a fair chunk of mocking to do it as a Synapse-only test.
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.
Interesting. The room id is actually one of his own, since his user originally created the room.
A little bit off topic: The server only finds the room again when a local user is invited or with a foreign alias.
The conclusion: The test should be removed.
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.
The server name in any room ID is not meant to be parsed; it's only there to ensure that two servers don't create a room with the same room ID.
That's why the room ID having been created by this server is actually irrelevant here, I think.
(This surprises people: they assume that
!blahblah:example.com
should be enough to join a room viaexample.com
and are confused when Synapse will refuse to if you don't tell it any server names. There are also proposals to remove the server name from room IDs, if I remember, instead using the hash of the create event or something equivalent.)This is more or less what I'd expect: in both those cases, the server gets a list of other servers that are in the room.
The server then knows which server it can use to do the
/make_join
,/send_join
handshake with — see https://spec.matrix.org/v1.3/server-server-api/#joining-rooms if you haven't already to get a picture of how this works.Joining a remote room requires you to know at least one server that's in the room already, otherwise you have nowhere to join it via.
I agree with @DMRobertson here that a Complement test for this seems like it would be ideal, since it would let you prove this works externally with 2 real servers and you don't have to do a lot of mocking.