Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Consider cancelled verifications when mounting IncomingSasDialog #3123

Merged
merged 2 commits into from
Jun 20, 2019

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented Jun 19, 2019

The cancellation can be because of a background problem, or because the user received another verification request from the same user. The cancel function does get called, however due to the speed of our dialog handling the state ends up being lost forever. Instead of trying to de-layer dialogs, this just fastforwards the whole dialog to "cancelled" on mount if required.

Fixes element-hq/element-web#10118
Fixes element-hq/element-web#9103 (or maybe just the js-sdk PR does? idk)
Requires matrix-org/matrix-js-sdk#961

The cancellation can be because of a background problem, or because the user received another verification request from the same user. The cancel function does get called, however due to the speed of our dialog handling the state ends up being lost forever. Instead of trying to de-layer dialogs, this just fastforwards the whole dialog to "cancelled" on mount if required.

Fixes element-hq/element-web#10118
@turt2live turt2live requested a review from a team June 19, 2019 21:00
turt2live added a commit to matrix-org/matrix-js-sdk that referenced this pull request Jun 19, 2019
Fixes element-hq/element-web#10083
Fixes element-hq/element-web#9197
Fixes element-hq/element-web#8629

The issue is partially fixed by matrix-org/matrix-react-sdk#3123 in that users would no longer see "Incoming request", but would launch their client to a bunch of "key verification cancelled" dialogs. To work around this, we just don't handle key verification requests which we know are cancelled.

The changes are a bit awkward (flagging the event as cancelled instead of filtering it) because:
* We probably don't want to prevent events getting sent over the EventEmitter because applications may still rely on them.
* The cypto side only has visibility of 1 event at a time, so it needs to have some kind of flag to rely on.

An attempt has been made to generalize the new event flag for possible future cases.
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise lgtm

src/components/views/dialogs/IncomingSasDialog.js Outdated Show resolved Hide resolved
@turt2live turt2live merged commit 2a0660c into develop Jun 20, 2019
@turt2live turt2live deleted the travis/sas-timeouts branch June 20, 2019 20:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants