-
-
Notifications
You must be signed in to change notification settings - Fork 601
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
encrypt for invited users if history visibility allows. #666
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
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.
Hard to check from my phone, but I worry about this causing (more) device tracking bugs, since we won't be reliably receiving device list updates from this user, but maybe we will think we are up to date, and hence not resync once the user does join the room?
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.
Agreed that encrypting messages to invited user could work unreliably if the server doesn't have the corresponding change, but it should be limited to invited users, right? Messages to joined user should work no worse than before?
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.
Actually no, I see what you mean. If the server doesn't have matrix-org/synapse#3484 then it breaks when:
startTrackingDeviceList(bob)
but nothing will happen because Bob is already tracked.In other words, I think this is perfectly safe in the situation where we can be sure the server will have matrix-org/synapse#3484 . In the real world, one workaround could be to always force a re-fetch of the device list for a user when their membership transitions to
join
in any room?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 of course assumes the synapse patch works, and is going to send enough devicelist updates for invited users correctly. i will test by seeing what happens if you add a device to an invited user before they join the room. (and then for the dumb synapse scenario, explicitly refetch the list when they join, as dave says)
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.
actually, it's going to be really hard for me to investigate this today, and we ideally need it for tomorrow. @dbkr: would you be able to check the concern above (and mitigate it by resyncing on /join if needed)?
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.
Following up, there was much discussion and the conclusion is that there's a big edge case here in that federated servers do not know what other servers are in the room at the time they've been invited. They therefore will not send device updates if a user logs in whilst their state is
invite
.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.
Also, I think you forgot to commit where you added
shouldEncryptForInvitedUsers
?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.
Fixed. Having looks into forcing an update when a member joins the room, actually it's not necessary since synapse sends a device list update when the user joins the room anyway. Arguably this is synapse impl specific behaviour though.