Merge pull request #3619 from matrix-org/travis/deactivate-2
Add better error handling to Synapse user deactivation
This commit is contained in:
commit
d15722d4c9
3 changed files with 16 additions and 4 deletions
|
@ -1027,10 +1027,13 @@ const UserInfo = withLegacyMatrixClient(({matrixClient: cli, user, groupId, room
|
||||||
const [accepted] = await finished;
|
const [accepted] = await finished;
|
||||||
if (!accepted) return;
|
if (!accepted) return;
|
||||||
try {
|
try {
|
||||||
cli.deactivateSynapseUser(user.userId);
|
await cli.deactivateSynapseUser(user.userId);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.error("Failed to deactivate user");
|
||||||
|
console.error(err);
|
||||||
|
|
||||||
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
|
const ErrorDialog = sdk.getComponent('dialogs.ErrorDialog');
|
||||||
Modal.createTrackedDialog('Failed to deactivate user', '', ErrorDialog, {
|
Modal.createTrackedDialog('Failed to deactivate Synapse user', '', ErrorDialog, {
|
||||||
title: _t('Failed to deactivate user'),
|
title: _t('Failed to deactivate user'),
|
||||||
description: ((err && err.message) ? err.message : _t("Operation failed")),
|
description: ((err && err.message) ? err.message : _t("Operation failed")),
|
||||||
});
|
});
|
||||||
|
|
|
@ -550,7 +550,16 @@ module.exports = createReactClass({
|
||||||
danger: true,
|
danger: true,
|
||||||
onFinished: (accepted) => {
|
onFinished: (accepted) => {
|
||||||
if (!accepted) return;
|
if (!accepted) return;
|
||||||
this.context.matrixClient.deactivateSynapseUser(this.props.member.userId);
|
this.context.matrixClient.deactivateSynapseUser(this.props.member.userId).catch(e => {
|
||||||
|
console.error("Failed to deactivate user");
|
||||||
|
console.error(e);
|
||||||
|
|
||||||
|
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
|
Modal.createTrackedDialog('Failed to deactivate Synapse user', '', ErrorDialog, {
|
||||||
|
title: _t('Failed to deactivate user'),
|
||||||
|
description: ((e && e.message) ? e.message : _t("Operation failed")),
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -868,6 +868,7 @@
|
||||||
"Deactivate user?": "Deactivate user?",
|
"Deactivate user?": "Deactivate user?",
|
||||||
"Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?": "Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?",
|
"Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?": "Deactivating this user will log them out and prevent them from logging back in. Additionally, they will leave all the rooms they are in. This action cannot be reversed. Are you sure you want to deactivate this user?",
|
||||||
"Deactivate user": "Deactivate user",
|
"Deactivate user": "Deactivate user",
|
||||||
|
"Failed to deactivate user": "Failed to deactivate user",
|
||||||
"Failed to change power level": "Failed to change power level",
|
"Failed to change power level": "Failed to change power level",
|
||||||
"You will not be able to undo this change as you are promoting the user to have the same power level as yourself.": "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.",
|
"You will not be able to undo this change as you are promoting the user to have the same power level as yourself.": "You will not be able to undo this change as you are promoting the user to have the same power level as yourself.",
|
||||||
"Are you sure?": "Are you sure?",
|
"Are you sure?": "Are you sure?",
|
||||||
|
@ -1081,7 +1082,6 @@
|
||||||
"Failed to withdraw invitation": "Failed to withdraw invitation",
|
"Failed to withdraw invitation": "Failed to withdraw invitation",
|
||||||
"Failed to remove user from community": "Failed to remove user from community",
|
"Failed to remove user from community": "Failed to remove user from community",
|
||||||
"<strong>%(role)s</strong> in %(roomName)s": "<strong>%(role)s</strong> in %(roomName)s",
|
"<strong>%(role)s</strong> in %(roomName)s": "<strong>%(role)s</strong> in %(roomName)s",
|
||||||
"Failed to deactivate user": "Failed to deactivate user",
|
|
||||||
"This client does not support end-to-end encryption.": "This client does not support end-to-end encryption.",
|
"This client does not support end-to-end encryption.": "This client does not support end-to-end encryption.",
|
||||||
"Messages in this room are not end-to-end encrypted.": "Messages in this room are not end-to-end encrypted.",
|
"Messages in this room are not end-to-end encrypted.": "Messages in this room are not end-to-end encrypted.",
|
||||||
"Messages in this room are end-to-end encrypted.": "Messages in this room are end-to-end encrypted.",
|
"Messages in this room are end-to-end encrypted.": "Messages in this room are end-to-end encrypted.",
|
||||||
|
|
Loading…
Reference in a new issue