Join Chat appends Matrix server name preventing us to join a different homeserver
Categories
(Chat Core :: Matrix, defect, P1)
Tracking
(thunderbird_esr78+ fixed, thunderbird81 affected)
People
(Reporter: sdk, Assigned: khushil324)
References
Details
Attachments
(1 file, 3 obsolete files)
3.46 KB,
patch
|
khushil324
:
review+
wsmwk
:
approval-comm-esr78+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0
Steps to reproduce:
- Open the Chat tab
- Connect to your Matrix account (e.g. @username:matrix.org)
- Click on "Join Chat" button
- Enter a room name from a different homeserver (e.g. #maildev:mozilla.org)
Actual results:
The chat join a room called #room_name:server_name:account_server_name.tld (e.g. #maildev:mozilla.org:matrix.org)
Expected results:
If a server name is specified, Join Chat shouldn't append the account server name.
Updated•4 years ago
|
Comment 1•4 years ago
|
||
I think Khushil had a patch for this?
Assignee | ||
Comment 2•4 years ago
|
||
Comment 3•4 years ago
|
||
Comment on attachment 9170440 [details] [diff] [review] Bug-1657797_update-join-chat-matrix-0.patch Review of attachment 9170440 [details] [diff] [review]: ----------------------------------------------------------------- ::: chat/protocols/matrix/matrix.jsm @@ +812,3 @@ > // For the format of room id and alias, see the matrix documentation: > // https://matrix.org/docs/spec/intro.html#room-structure > // https://matrix.org/docs/spec/intro.html#room-aliases Please update these links to: https://matrix.org/docs/spec/appendices#room-ids-and-event-ids https://matrix.org/docs/spec/appendices#room-aliases @@ +812,5 @@ > // For the format of room id and alias, see the matrix documentation: > // https://matrix.org/docs/spec/intro.html#room-structure > // https://matrix.org/docs/spec/intro.html#room-aliases > + let roomIdOrAlias = components.getValue("roomIdOrAlias").trim(); > + if (roomIdOrAlias.startsWith("!")) { I'm having trouble following what the code in this if-statement is doing. Can you add a comment? @@ +828,2 @@ > } > + let domain = this._client.getDomain(); I think we can just inline this below instead of using a separate variable. @@ +832,3 @@ > } > > + if (!roomIdOrAlias.startsWith("@") && !roomIdOrAlias.startsWith("#")) { I do not believe that @ can be the first character of an alias or room ID.
Assignee | ||
Comment 4•4 years ago
|
||
Assignee | ||
Comment 5•4 years ago
|
||
Comment 6•4 years ago
|
||
(In reply to Patrick Cloke [:clokep] from comment #3)
@@ +832,3 @@
}
- if (!roomIdOrAlias.startsWith("@") && !roomIdOrAlias.startsWith("#")) {
I do not believe that @ can be the first character of an alias or room ID.
I see that you added some comments about this, but I don't see this anywhere in the specification? In fact, when I look at room IDs I see they all start with "!". So where is this idea of it starting with an "@" coming from? I don't see that in the UI of Element or anywhere else.
Assignee | ||
Comment 7•4 years ago
|
||
So how do we add/create rooms for direct conversations? getDirectConversation function creates the direct conversation rooms when we pass the userID. If id is starting with "@", means it's a user ID.
Comment 8•4 years ago
|
||
(In reply to Khushil Mistry [:khushil324] from comment #7)
So how do we add/create rooms for direct conversations? getDirectConversation function creates the direct conversation rooms when we pass the userID. If id is starting with "@", means it's a user ID.
So you're not suggesting that this is meant to be a proper ID, but just a way to start a direct conversation with someone (similar to double clicking on their name)?
Assignee | ||
Comment 9•4 years ago
|
||
Yes, right.
Comment 10•4 years ago
|
||
Comment on attachment 9171149 [details] [diff] [review] Bug-1657797_update-join-chat-matrix-2.patch Review of attachment 9171149 [details] [diff] [review]: ----------------------------------------------------------------- Looks good! I asked for a couple of comments to be clarified and one block of code to be moved. Let me know if moving it doesn't make sense for some reason! Sorry for the delay. :) ::: chat/protocols/matrix/matrix.jsm @@ +816,5 @@ > + // There will be following types of ids: > + // !fubIsJzeAcCcjYTQvm:mozilla.org => General room id. > + // #maildev:mozilla.org => Group Conversation room id. > + // @clokep:mozilla.org => Direct Conversation room id. > + if (roomIdOrAlias.startsWith("!")) { I think we should be appending the domain before this if statement (so that things like !fubIsJzeAcCcjYTQvm will work). @@ +838,4 @@ > } > > + // If @ or # is not provided in the id, assume it as group conversation > + // and append "#". Please update this to: > If the ID does not start with @ or #, assume it is a group conversation and append #. @@ +841,5 @@ > + // and append "#". > + if (!roomIdOrAlias.startsWith("@") && !roomIdOrAlias.startsWith("#")) { > + roomIdOrAlias = "#" + roomIdOrAlias; > + } > + // If it's room-id is of type direct chat, open the direct conversation. > If the ID starts with a @, it is a direct conversation. @@ +845,5 @@ > + // If it's room-id is of type direct chat, open the direct conversation. > + if (roomIdOrAlias.startsWith("@")) { > + return this.getDirectConversation(roomIdOrAlias); > + } > + // If it's room-id is of type group chat, open the group conversation. > Otherwise, it is a group conversation.
Assignee | ||
Comment 11•4 years ago
|
||
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 12•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/768dcaaaefe9
Update join chat functionality in Matrix. r=clokep DONTBUILD
Comment 13•4 years ago
|
||
Uplift to 78?
Assignee | ||
Comment 14•4 years ago
|
||
Comment on attachment 9175695 [details] [diff] [review]
Bug-1657797_update-join-chat-matrix-3.patch
[Approval Request Comment]
Regression caused by (bug #):
User impact if declined: Matrix Chat experience will be improved.
Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky): Low
Comment 15•4 years ago
|
||
Comment on attachment 9175695 [details] [diff] [review]
Bug-1657797_update-join-chat-matrix-3.patch
[Triage Comment]
Approved for esr78
Comment 16•4 years ago
|
||
bugherder uplift |
Thunderbird 78.4.0:
https://hg.mozilla.org/releases/comm-esr78/rev/47cf0ae22adc
Description
•