Handle M_UNSUPPORTED_ROOM_VERSION in invites and room creation

Fixes https://github.com/vector-im/riot-web/issues/8925
This commit is contained in:
Travis Ralston 2019-04-09 19:03:38 -06:00
parent 687b43f7b4
commit d755263e33
3 changed files with 15 additions and 3 deletions

View file

@ -122,9 +122,16 @@ function createRoom(opts) {
action: 'join_room_error',
});
console.error("Failed to create room " + roomId + " " + err);
let description = _t("Server may be unavailable, overloaded, or you hit a bug.");
if (err.errcode === "M_UNSUPPORTED_ROOM_VERSION") {
// Technically not possible with the UI as of April 2019 because there's no
// options for the user to change this. However, it's not a bad thing to report
// the error to the user for if/when the UI is available.
description = _t("The server does not support the room version specified.");
}
Modal.createTrackedDialog('Failure to create room', '', ErrorDialog, {
title: _t("Failure to create room"),
description: _t("Server may be unavailable, overloaded, or you hit a bug."),
description,
});
return null;
});

View file

@ -47,8 +47,9 @@
"The file '%(fileName)s' failed to upload.": "The file '%(fileName)s' failed to upload.",
"The file '%(fileName)s' exceeds this homeserver's size limit for uploads": "The file '%(fileName)s' exceeds this homeserver's size limit for uploads",
"Upload Failed": "Upload Failed",
"Failure to create room": "Failure to create room",
"Server may be unavailable, overloaded, or you hit a bug.": "Server may be unavailable, overloaded, or you hit a bug.",
"The server does not support the room version specified.": "The server does not support the room version specified.",
"Failure to create room": "Failure to create room",
"Send anyway": "Send anyway",
"Send": "Send",
"Sun": "Sun",
@ -258,6 +259,7 @@
"User %(user_id)s does not exist": "User %(user_id)s does not exist",
"User %(user_id)s may or may not exist": "User %(user_id)s may or may not exist",
"The user must be unbanned before they can be invited.": "The user must be unbanned before they can be invited.",
"The user's homeserver does not support the version of the room.": "The user's homeserver does not support the version of the room.",
"Unknown server error": "Unknown server error",
"Use a few words, avoid common phrases": "Use a few words, avoid common phrases",
"No need for symbols, digits, or uppercase letters": "No need for symbols, digits, or uppercase letters",
@ -472,6 +474,7 @@
"All keys backed up": "All keys backed up",
"Backup has a signature from <verify>unknown</verify> device with ID %(deviceId)s.": "Backup has a signature from <verify>unknown</verify> device with ID %(deviceId)s.",
"Backup has a <validity>valid</validity> signature from this device": "Backup has a <validity>valid</validity> signature from this device",
"Backup has an <validity>invalid</validity> signature from this device": "Backup has an <validity>invalid</validity> signature from this device",
"Backup has a <validity>valid</validity> signature from <verify>verified</verify> device <device></device>": "Backup has a <validity>valid</validity> signature from <verify>verified</verify> device <device></device>",
"Backup has a <validity>valid</validity> signature from <verify>unverified</verify> device <device></device>": "Backup has a <validity>valid</validity> signature from <verify>unverified</verify> device <device></device>",
"Backup has an <validity>invalid</validity> signature from <verify>verified</verify> device <device></device>": "Backup has an <validity>invalid</validity> signature from <verify>verified</verify> device <device></device>",
@ -958,7 +961,6 @@
"Join": "Join",
"No results": "No results",
"Communities": "Communities",
"Home": "Home",
"You cannot delete this image. (%(code)s)": "You cannot delete this image. (%(code)s)",
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
"Rotate counter-clockwise": "Rotate counter-clockwise",
@ -1272,6 +1274,7 @@
"Set a new status...": "Set a new status...",
"View Community": "View Community",
"Hide": "Hide",
"Home": "Home",
"Sign in": "Sign in",
"Login": "Login",
"powered by Matrix": "powered by Matrix",

View file

@ -178,6 +178,8 @@ export default class MultiInviter {
this._doInvite(address, true).then(resolve, reject);
} else if (err.errcode === "M_BAD_STATE") {
errorText = _t("The user must be unbanned before they can be invited.");
} else if (err.errcode === "M_UNSUPPORTED_ROOM_VERSION") {
errorText = _t("The user's homeserver does not support the version of the room.");
} else {
errorText = _t('Unknown server error');
}