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

Commit

Permalink
Log phases in the verification process
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
richvdh committed Sep 4, 2024
1 parent 6bfdb3e commit 22185f6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/views/right_panel/EncryptionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
import React, { useCallback, useEffect, useRef, useState } from "react";
import { VerificationPhase, VerificationRequest, VerificationRequestEvent } from "matrix-js-sdk/src/crypto-api";
import { RoomMember, User } from "matrix-js-sdk/src/matrix";
import { logger } from "matrix-js-sdk/src/logger";

import EncryptionInfo from "./EncryptionInfo";
import VerificationPanel from "./VerificationPanel";
Expand Down Expand Up @@ -48,7 +49,12 @@ const EncryptionPanel: React.FC<IProps> = (props: IProps) => {
// state to show a spinner immediately after clicking "start verification",
// before we have a request
const [isRequesting, setRequesting] = useState(false);
const [phase, setPhase] = useState(request?.phase);
const [phase, doSetPhase] = useState(request?.phase);
const setPhase = (phase: VerificationPhase | undefined): void => {
logger.debug(`EncryptionPanel: phase now ${phase === undefined ? phase : VerificationPhase[phase]}`);
doSetPhase(phase);
};

useEffect(() => {
setRequest(verificationRequest);
if (verificationRequest) {
Expand Down

0 comments on commit 22185f6

Please sign in to comment.