Fix not being able to DM users with non-ascii usernames#271
Open
Fix not being able to DM users with non-ascii usernames#271
Conversation
0f81080 to
3450988
Compare
tadzik
commented
Jul 30, 2021
Remote usernames with multibyte characters in them currently get encoded into mxids in a way that may result in information loss (see matrix-org/matrix-appservice-bridge#346). This makes it impossible to reach some users by MXID alone, so this makes it lookup the MXID in the user store, which contains the original, unmangled username. Fixes GH-268.
3450988 to
d83aed1
Compare
jaller94
previously requested changes
Aug 3, 2021
Contributor
jaller94
left a comment
There was a problem hiding this comment.
The failing test doesn't look trivial.
That should get fixed first.
| if (remoteUsers.length > 1) { | ||
| log.error( | ||
| `Multiple remote users found for ${event.state_key!}:`, | ||
| remoteUsers.map(u => `${u.protocolId}://${u.username}`).join(', ') |
Contributor
There was a problem hiding this comment.
Is this supposed to look like an URI with ://?
The lines below just separate the protocol and username with a colon.
Contributor
Author
There was a problem hiding this comment.
Yeah – it follows the convention we often use in the logs, like here.
The regular colon usage below is mostly arbitrary, I think. @Half-Shot?
Contributor
Author
Which test? |
|
@tadzik: Have you progressed on your PR about @jaller94 comment? @Half-Shot: What do you think? |
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 free
to 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.
Remote usernames with multibyte characters in them currently get encoded
into mxids in a way that may result in information loss
(see matrix-org/matrix-appservice-bridge#346).
This makes it impossible to reach some users by MXID alone, so this
makes it lookup the MXID in the user store, which contains the original,
unmangled username.
Fixes GH-268.