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

Commit 6490742

Browse files
authored
Log phases in the verification process (#12963)
When the EncryptionPanel (which does the work of the verification flow) changes "phase", log it. I hope this will be helpful when diagnosing stuck verifications.
1 parent cdffbdb commit 6490742

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/components/views/right_panel/EncryptionPanel.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
import React, { useCallback, useEffect, useRef, useState } from "react";
1818
import { VerificationPhase, VerificationRequest, VerificationRequestEvent } from "matrix-js-sdk/src/crypto-api";
1919
import { RoomMember, User } from "matrix-js-sdk/src/matrix";
20+
import { logger } from "matrix-js-sdk/src/logger";
2021

2122
import EncryptionInfo from "./EncryptionInfo";
2223
import VerificationPanel from "./VerificationPanel";
@@ -48,7 +49,12 @@ const EncryptionPanel: React.FC<IProps> = (props: IProps) => {
4849
// state to show a spinner immediately after clicking "start verification",
4950
// before we have a request
5051
const [isRequesting, setRequesting] = useState(false);
51-
const [phase, setPhase] = useState(request?.phase);
52+
const [phase, doSetPhase] = useState(request?.phase);
53+
const setPhase = (phase: VerificationPhase | undefined): void => {
54+
logger.debug(`EncryptionPanel: phase now ${phase === undefined ? phase : VerificationPhase[phase]}`);
55+
doSetPhase(phase);
56+
};
57+
5258
useEffect(() => {
5359
setRequest(verificationRequest);
5460
if (verificationRequest) {

0 commit comments

Comments
 (0)