mirror of
https://github.com/selfxyz/self.git
synced 2026-04-27 03:01:15 -04:00
* Fix recovery rollback handling * Restore registration state on rollback * Restore selected document on rollback * fix(webview): clear both keys on partial rollback to prevent mnemonic/secret mismatch When restoreSnapshotBestEffort partially fails (e.g. mnemonic rollback fails but secret rollback succeeds), the stored mnemonic and private key can end up mismatched — deriving from the stored mnemonic produces a different key than what's stored. This is silent data corruption that could lock users out of recovery. Fix: when any rollback write fails, clear both keys so ensureSecret can regenerate a consistent pair from scratch. A missing pair is recoverable; a mismatched pair is not. Adds a test in restoreSecretFromMnemonic that proves the mismatch scenario and verifies both keys are cleared. * feat(new-common): add humanizeContractError utility with tests * fix: prettier formatting in secretManager test --------- Co-authored-by: Tranquil-Flow <tranquil_flow@protonmail.com>