-
-
Notifications
You must be signed in to change notification settings - Fork 831
Provide a more detailed error message than "No known servers" #6048
Changes from 13 commits
efd793c
513300a
bcb12af
9b33261
3f4ee2f
72f9d7a
b6aa7e6
bfb5707
170da1b
26f974d
c58fe0b
0c52759
0b3f050
78eb743
c72ac81
2791011
030ced3
6c72541
19ad1a2
ce8c0d9
a99f514
b2b4732
e3982da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -437,7 +437,7 @@ export class RoomViewStore extends Store<ActionPayload> { | |||||||||||||||||||||||||
</div>; | ||||||||||||||||||||||||||
} else if (err.httpStatus === 404) { | ||||||||||||||||||||||||||
const invitingUserId = this.getInvitingUserId(roomId); | ||||||||||||||||||||||||||
// only provide a better error message for invites | ||||||||||||||||||||||||||
// provide a better error message for invites | ||||||||||||||||||||||||||
if (invitingUserId) { | ||||||||||||||||||||||||||
// if the inviting user is on the same HS, there can only be one cause: they left. | ||||||||||||||||||||||||||
if (invitingUserId.endsWith(`:${MatrixClientPeg.get().getDomain()}`)) { | ||||||||||||||||||||||||||
|
@@ -446,6 +446,33 @@ export class RoomViewStore extends Store<ActionPayload> { | |||||||||||||||||||||||||
description = _t("The person who invited you has already left, or their server is offline."); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
// if joined through room ID and didn't provide any via servers, provide | ||||||||||||||||||||||||||
// a more detailed error than "No known servers" | ||||||||||||||||||||||||||
if (roomId === this.state.roomId && !this.state.viaServers?.length) { | ||||||||||||||||||||||||||
description = <div> | ||||||||||||||||||||||||||
{ _t("This Room ID (%(id)s) cannot be joined. Try to join using a Room " + | ||||||||||||||||||||||||||
"Alias (#room:example.com) instead.", { | ||||||||||||||||||||||||||
id: this.state.roomId, | ||||||||||||||||||||||||||
}) }<br /><br /> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
<details> | ||||||||||||||||||||||||||
<summary>{ _t("Why?") }</summary><br /> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
{ _t("A Room ID alone cannot be used to join a room unless your " + | ||||||||||||||||||||||||||
"homeserver already participates in that room.") }<br /><br /> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
{ _t("For a Room ID to be joinable over federation, a list of " + | ||||||||||||||||||||||||||
"homeservers to attempt to join through must be provided. " + | ||||||||||||||||||||||||||
"You didn't provide any.") }<br /><br /> | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
{ _t("The sole purpose of the domain at the end of a Room ID " + | ||||||||||||||||||||||||||
"is to ensure it is unique.") }<br /><br /> | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
{ _t("For these reasons, Room Aliases are the recommended way to join rooms.") } | ||||||||||||||||||||||||||
</details> | ||||||||||||||||||||||||||
</div>; | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to https://github.com/vector-im/element-web/issues/24475 Maybe some language inspiration in this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not all rooms have an alias and you can stumble upon a room ID in an unlimited number of ways. The user obviously tried to use a room ID here and we should make it possible for them to continue with what they have. Leaving the user helpless to go ask someone else for a room alias isn't very empowering. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have any data to argue that point, except I think the user probably doesn't have that choice and can at best make a very educated guess. However I do disagree with your previous suggestion:
Honestly, either
The best I can come up with is to "try using the server (latter part of matrix ID) or a user who you know is in the room as a via server)". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
All room IDs include this information at the moment. And is why I created https://github.com/vector-im/element-web/issues/24475 to suggest to people how to do the right thing (derive the via server from the room ID)
Agreed that this should just be automatic, but I think we're at ideological odds with the decision makers since they would want to treat room IDs as opaque strings that shouldn't be parsed. Treating it as an opaque string is generally a good heuristic since there is some future-looking here where room IDs potentially won't include this information (wish I had some links for future desire). The half-measure of suggesting the right thing at least gets them to the right place and teaches for next time. And I think has the potential to actually be merged. |
||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
Modal.createDialog(ErrorDialog, { | ||||||||||||||||||||||||||
|
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.
I'm not entirely sure how this needs to be formatted/escaped, but here goes: