Emit finished() and delete remotely cancelled verification session #865
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prevents a potential verification session leak but may break clients if they relied on the remotely cancelled session to still be around and not emit
finished()
- to me that feels like a misuse, so I'm sending this to 0.9.x even though this change may break this misuse.Commit message with details:
KeyVerificationSession emits finished() and self-deletes on any wrong situation but only changes state if a remote device simply cancels the verification, as if it were not an endgame. This commit pulls the common code from cancelVerification() into handleCancel() and calls that new function when KeyVerificationCancelEvent is received. It also makes sure now not to call cancelVerification() twice with different error codes.