Skip to content

Cleanup databases after logout#972

Draft
corbanbrook wants to merge 1 commit intomasterfrom
logout-cleanup
Draft

Cleanup databases after logout#972
corbanbrook wants to merge 1 commit intomasterfrom
logout-cleanup

Conversation

@corbanbrook
Copy link
Contributor

@corbanbrook corbanbrook commented Mar 2, 2026

New _cleanupWalletData(wallet) method (lines 1258–1280):

  • Fetches all records from signatures, transactions, messages, and recovery databases in parallel
  • Deletes any records belonging to the logged-out wallet address (using Address.isEqual for case-insensitive comparison)
  • Best-effort cleanup of auth keys: fetches the wallet's loginTopology, extracts its signers, and deletes their corresponding AuthKey entries
  • Auth key cleanup is wrapped in try/catch so an offline state won't block the logout

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant