Add better error handling to Synapse user deactivation
Also clearly flag it as a Synapse user deactivation in the analytics, so we don't get confused. Fixes https://github.com/vector-im/riot-web/issues/10986pull/21833/head
							parent
							
								
									4258a824df
								
							
						
					
					
						commit
						b05dabe2b7
					
				|  | @ -842,10 +842,13 @@ const UserInfo = withLegacyMatrixClient(({matrixClient: cli, user, groupId, room | |||
|         const [accepted] = await finished; | ||||
|         if (!accepted) return; | ||||
|         try { | ||||
|             cli.deactivateSynapseUser(user.userId); | ||||
|             await cli.deactivateSynapseUser(user.userId); | ||||
|         } catch (err) { | ||||
|             console.error("Failed to deactivate user"); | ||||
|             console.error(err); | ||||
| 
 | ||||
|             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'), | ||||
|                 description: ((err && err.message) ? err.message : _t("Operation failed")), | ||||
|             }); | ||||
|  |  | |||
|  | @ -550,7 +550,16 @@ module.exports = createReactClass({ | |||
|             danger: true, | ||||
|             onFinished: (accepted) => { | ||||
|                 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")), | ||||
|                     }); | ||||
|                 }); | ||||
|             }, | ||||
|         }); | ||||
|     }, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Travis Ralston
						Travis Ralston