Cleanup databases after logout#972
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7222f7121b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const [sigs, txns, msgs, recovery] = await Promise.all([ | ||
| this.shared.databases.signatures.list(), | ||
| this.shared.databases.transactions.list(), | ||
| this.shared.databases.messages.list(), | ||
| this.shared.databases.recovery.list(), | ||
| ]) |
There was a problem hiding this comment.
Make wallet DB cleanup best-effort during logout
_cleanupWalletData runs list()/del() calls in fail-fast Promise.all blocks without handling errors, so any IndexedDB failure (e.g., transient open/transaction errors) will reject logout/completeLogout after the manager entry and device have already been removed. In that state the caller sees logout as failed, but retries can no longer proceed because the wallet record is gone, leaving a partial and hard-to-recover flow. This cleanup should be non-blocking (or individually guarded) like the auth-key cleanup path.
Useful? React with 👍 / 👎.
New
_cleanupWalletData(wallet)method (lines 1258–1280):Soft logout (skipRemoveDevice: true branch, line 1201): calls _cleanupWalletData after the manager entry and device are removed.
Hard logout (completeLogout, line 1255): calls _cleanupWalletData after the configuration update is committed and the manager entry/device are removed.