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

Commit

Permalink
Remove redundant verifier.done() call
Browse files Browse the repository at this point in the history
This `done` call completes the verification process and stops it responding
with further messages. It is unnecessary, *provided* the verification completes
successfully, for which see
matrix-org/matrix-js-sdk#3382.
  • Loading branch information
richvdh committed May 18, 2023
1 parent d9d5387 commit 9eb2341
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cypress/e2e/crypto/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,19 @@ export function waitForVerificationRequest(cli: MatrixClient): Promise<Verificat
}

/**
* Handle an incoming verification request
* Automatically handle an incoming verification request
*
* Starts the key verification process, and, once it is accepted on the other side, confirms that the
* emojis match.
*
* Returns a promise that resolves, with the emoji list, once we confirm the emojis
*
* @param request - incoming verification request
* @returns A promise that resolves, with the emoji list, once we confirm the emojis
*/
export function handleVerificationRequest(request: VerificationRequest) {
export function handleVerificationRequest(request: VerificationRequest): Promise<EmojiMapping[]> {
return new Promise<EmojiMapping[]>((resolve) => {
const onShowSas = (event: ISasEvent) => {
verifier.off("show_sas", onShowSas);
event.confirm();
verifier.done();
resolve(event.sas.emoji);
};

Expand Down

0 comments on commit 9eb2341

Please sign in to comment.