Skip to content

fix(matrix): prevent double bootstrapCrossSigning reset in forced reset - #95720

Merged
steipete merged 15 commits into
mainfrom
maint/recover-pr-93328-matrix-force-reset
Jun 22, 2026
Merged

steipete merged 15 commits into
mainfrom
maint/recover-pr-93328-matrix-force-reset

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes #78396.

This restores the reviewed Matrix E2EE fix from #93328 after the contributor fork branch became unavailable during maintainer sync. --force-reset-cross-signing must not rotate cross-signing, fail on stale/broken SSSS, recreate secret storage, and then rotate again.

Why This Change Was Made

Forced reset now fails closed unless the active Matrix secret-storage recovery key can authenticate the current SSSS key before destructive cross-signing reset work starts. The branch preserves the original reviewed diff and commit authors from #93328, rebased onto current main.

User Impact

Matrix operators get a guarded forced-reset path that avoids destroying E2EE state when the active recovery material cannot unlock secret storage. Docs and Matrix QA messaging explain the active recovery-key requirement.

Evidence

  • Replaces fix(matrix): prevent double bootstrapCrossSigning reset in --force-reset-cross-signing #93328.
  • Autoreview on the original reviewed diff: clean, no accepted/actionable findings.
  • Blacksmith Testbox tbx_01kvq31d9z1hc09q946wr8nj99: node scripts/run-vitest.mjs extensions/matrix/src/matrix/sdk/crypto-bootstrap.test.ts extensions/matrix/src/matrix/sdk/recovery-key-store.test.ts extensions/matrix/src/matrix/sdk.test.ts passed, 3 files / 121 tests.
  • Exact-head GitHub CI pending for this maintainer branch.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: matrix Channel integration: matrix size: M maintainer Maintainer-authored PR labels Jun 22, 2026
@vincentkoc vincentkoc self-assigned this Jun 22, 2026
@vincentkoc
vincentkoc force-pushed the maint/recover-pr-93328-matrix-force-reset branch from bb2b62c to 577ff15 Compare June 22, 2026 09:22
@vincentkoc
vincentkoc force-pushed the maint/recover-pr-93328-matrix-force-reset branch from 577ff15 to afa7684 Compare June 22, 2026 09:35
@steipete

Copy link
Copy Markdown
Contributor

Land-ready maintainer verification:

  • Deep review covered the forced-reset entry point, Matrix SDK cross-signing/secret-storage behavior, recovery-key persistence, callers, sibling retry paths, and scoped docs. The safe public-API fix validates durable or explicitly staged recovery material before mutation, performs one reset at most, and fails closed instead of generating another identity.

  • Fresh autoreview: clean after resolving the recovery-key authentication and durability findings.

  • Focused tests: Matrix SDK/bootstrap/recovery-store plus QA contract scenarios — 208 passed. Matrix CLI coverage also passed earlier in the fixup cycle.

  • Docs: pnpm docs:check-mdx passed 677 files; pnpm docs:check-links checked 4454 links with zero broken.

  • Live Matrix E2E: Azure Crabbox run run_b17135306943 passed matrix-e2ee-bootstrap-success 4/4 after establishing secret storage and then exercising the guarded reset. Run run_3cec59a9871f separately proved a fresh account without recovery material is rejected before reset.

  • Current prepared head: afa7684e4bf4e4a431ccd099af888f3999b439dc; exact-head hosted CI passed in run 27943401964.

  • scripts/pr prepare-run 95720: completed.

Known gaps: matrix-js-sdk does not expose an atomic/resumable reset API, so the deliberate product contract is to require the active recovery key before destructive reset.

@steipete
steipete merged commit 03a71f3 into main Jun 22, 2026
86 checks passed
@steipete
steipete deleted the maint/recover-pr-93328-matrix-force-reset branch June 22, 2026 09:45
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Thanks @vincentkoc!

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 23, 2026
…et (openclaw#95720)

Merged via squash.

Prepared head SHA: afa7684
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: steipete <58493+steipete@users.noreply.github.com>
Reviewed-by: @steipete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: matrix Channel integration: matrix docs Improvements or additions to documentation maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: --force-reset-cross-signing fires bootstrapCrossSigning TWICE, destroys E2EE state, leaves recovery-key.json pointing at empty secret storage

3 participants