From 484d9d708e52496dc41218b3c54b0662c03b1b33 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 6 Feb 2017 16:01:25 +0000 Subject: [PATCH] Logging to try to track down riot-web#3148 Since I can't figure out how this is happening, add a shedload of logging to try to pin it down. --- src/Modal.js | 6 ++++++ src/Resend.js | 8 ++++++++ .../views/dialogs/UnknownDeviceDialog.js | 18 ++++++++++++++++-- .../views/rooms/MessageComposerInputOld.js | 8 ++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/Modal.js b/src/Modal.js index b6cc46ed45..7be37da92e 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -43,7 +43,13 @@ const AsyncWrapper = React.createClass({ componentWillMount: function() { this._unmounted = false; + // XXX: temporary logging to try to diagnose + // https://github.com/vector-im/riot-web/issues/3148 + console.log('Starting load of AsyncWrapper for modal'); this.props.loader((e) => { + // XXX: temporary logging to try to diagnose + // https://github.com/vector-im/riot-web/issues/3148 + console.log('AsyncWrapper load completed with '+e.displayName); if (this._unmounted) { return; } diff --git a/src/Resend.js b/src/Resend.js index ad0f58eb9b..e2f0c5a1ee 100644 --- a/src/Resend.js +++ b/src/Resend.js @@ -29,11 +29,19 @@ module.exports = { event: event }); }, function(err) { + // XXX: temporary logging to try to diagnose + // https://github.com/vector-im/riot-web/issues/3148 + console.log('Resend got send failure: ' + err.name + '('+err+')'); if (err.name === "UnknownDeviceError") { var UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog"); Modal.createDialog(UnknownDeviceDialog, { devices: err.devices, room: MatrixClientPeg.get().getRoom(event.getRoomId()), + onFinished: (r) => { + // XXX: temporary logging to try to diagnose + // https://github.com/vector-im/riot-web/issues/3148 + console.log('UnknownDeviceDialog closed with '+r); + }, }, "mx_Dialog_unknownDevice"); } diff --git a/src/components/views/dialogs/UnknownDeviceDialog.js b/src/components/views/dialogs/UnknownDeviceDialog.js index 409852a2cc..3bebb8fdda 100644 --- a/src/components/views/dialogs/UnknownDeviceDialog.js +++ b/src/components/views/dialogs/UnknownDeviceDialog.js @@ -103,6 +103,10 @@ export default React.createClass({ MatrixClientPeg.get().setDeviceKnown(userId, deviceId, true); }); }); + + // XXX: temporary logging to try to diagnose + // https://github.com/vector-im/riot-web/issues/3148 + console.log('Opening UnknownDeviceDialog'); }, render: function() { @@ -137,7 +141,12 @@ export default React.createClass({ const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); return ( { + // XXX: temporary logging to try to diagnose + // https://github.com/vector-im/riot-web/issues/3148 + console.log("UnknownDeviceDialog closed by escape"); + this.props.onFinished(); + }} title='Room contains unknown devices' > @@ -152,7 +161,12 @@ export default React.createClass({
diff --git a/src/components/views/rooms/MessageComposerInputOld.js b/src/components/views/rooms/MessageComposerInputOld.js index b91e5c4391..63821b7d96 100644 --- a/src/components/views/rooms/MessageComposerInputOld.js +++ b/src/components/views/rooms/MessageComposerInputOld.js @@ -30,11 +30,19 @@ var TYPING_SERVER_TIMEOUT = 30000; var MARKDOWN_ENABLED = true; export function onSendMessageFailed(err, room) { + // XXX: temporary logging to try to diagnose + // https://github.com/vector-im/riot-web/issues/3148 + console.log('MessageComposer got send failure: ' + err.name + '('+err+')'); if (err.name === "UnknownDeviceError") { const UnknownDeviceDialog = sdk.getComponent("dialogs.UnknownDeviceDialog"); Modal.createDialog(UnknownDeviceDialog, { devices: err.devices, room: room, + onFinished: (r) => { + // XXX: temporary logging to try to diagnose + // https://github.com/vector-im/riot-web/issues/3148 + console.log('UnknownDeviceDialog closed with '+r); + }, }, "mx_Dialog_unknownDevice"); } dis.dispatch({