Skip to content

Commit

Permalink
Merge branch 'develop' into florianduros/security-key-to-recovery-key
Browse files Browse the repository at this point in the history
  • Loading branch information
florianduros authored Feb 7, 2025
2 parents 769c82a + 4a8ba81 commit ac8c2ee
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 32 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/triage-stale-flaky-tests.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/triage-stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Close stale issues & PRs
on:
workflow_dispatch: {}
schedule:
- cron: "30 1 * * *"
permissions: {}
jobs:
close:
runs-on: ubuntu-24.04
permissions:
actions: write
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
operations-per-run: 100
# Flaky test issue closing
only-issue-labels: "Z-Flaky-Test"
days-before-issue-stale: 14
days-before-issue-close: 0
close-issue-message: "This flaky test issue has not been updated in 14 days. It is being closed as presumed resolved."
exempt-issue-labels: "Z-Flaky-Test-Disabled"
# Stale PR closing
days-before-pr-stale: 180
days-before-pr-close: 0
close-pr-message: "This PR has been automatically closed because it has been stale for 180 days. If you wish to continue working on this PR, please ping a maintainer to reopen it."
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,12 @@ export function EncryptionUserSettingsTab({ initialState = "loading" }: Encrypti
);
break;
case "reset_identity_compromised":
content = (
<ResetIdentityPanel
variant="compromised"
onCancelClick={() => setState("main")}
onFinish={() => setState("main")}
/>
);
break;
case "reset_identity_forgot":
content = (
<ResetIdentityPanel
variant="forgot"
onCancelClick={() => setState("main")}
onFinish={() => setState("main")}
variant={state === "reset_identity_compromised" ? "compromised" : "forgot"}
onCancelClick={checkEncryptionState}
onFinish={checkEncryptionState}
/>
);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,30 @@ describe("<EncryptionUserSettingsTab />", () => {
screen.getByRole("heading", { name: "Forgot your recovery key? You’ll need to reset your identity." }),
).toBeVisible();
});

it("should re-check the encryption state and displays the correct panel when the user clicks cancel the reset identity flow", async () => {
const user = userEvent.setup();

// Secrets are not cached
jest.spyOn(matrixClient.getCrypto()!, "getCrossSigningStatus").mockResolvedValue({
privateKeysInSecretStorage: true,
publicKeysOnDevice: true,
privateKeysCachedLocally: {
masterKey: false,
selfSigningKey: true,
userSigningKey: true,
},
});

renderComponent({ initialState: "reset_identity_forgot" });

expect(
screen.getByRole("heading", { name: "Forgot your recovery key? You’ll need to reset your identity." }),
).toBeVisible();

await user.click(screen.getByRole("button", { name: "Back" }));
await waitFor(() =>
screen.getByText("Your key storage is out of sync. Click one of the buttons below to fix the problem."),
);
});
});

0 comments on commit ac8c2ee

Please sign in to comment.