Skip to content

fix(desktop): release Electron storage locks before wiping user data on Windows#28244

Draft
Copilot wants to merge 2 commits into
developfrom
copilot/fix-cannot-wipe-data-windows
Draft

fix(desktop): release Electron storage locks before wiping user data on Windows#28244
Copilot wants to merge 2 commits into
developfrom
copilot/fix-cannot-wipe-data-windows

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 1, 2026

On Windows, "Wipe data" from Debug settings fails with EBUSY: resource busy or locked because Electron's Chromium storage service holds open file handles on DIPS and DIPS-val SQLite databases in the user data directory while the app is running.

Description

  • packages/suite-desktop-core/src/libs/user-data.ts: In clear(), call session.defaultSession.clearStorageData() before fs.promises.rm(). This closes all storage handles held by the Chromium storage service (IndexedDB, cookies, DIPS, etc.), releasing the Windows file locks so the directory can be deleted.
+import { app, session, shell } from 'electron';

 export const clear = async (): Promise<InvokeResult> => {
     const dir = path.normalize(app.getPath('userData'));
     try {
+        // Clear session storage to release file locks before deleting user data directory.
+        // On Windows, Electron keeps DIPS and DIPS-val files locked by the storage service.
+        await session.defaultSession.clearStorageData();
         await fs.promises.rm(dir, { recursive: true, force: true });

Notes for QA

On Windows: Settings → Debug → Wipe data → should complete without EBUSY error and app should restart cleanly with no user data.

Related Issue

Screenshots:

wipe-data-ebusy-error

🔍 Currents Test Results

🔍 Suite desktop test results: View in Currents

🔍 Suite web test results: View in Currents

🔒 Quarantined E2E Tests

Trezor Suite (web) — 9 test(s)
Test Type
Account metadata > dropbox provider 🤖 auto
Passphrase with cardano > verify cardano address behind passphrase 🤖 auto
Cardano > Basic cardano walkthrough 🤖 auto
Public Keys > Check ada XPUB 🤖 auto
Account types suite > Add-account-types-non-BTC-coins 🤖 auto
Quarantine test: "Onboarding - create wallet,Success (basic)" 🙋 manual
Quarantine test: "Database migration,Db migration between: release/22.5/web => develop/web" 🙋 manual
Quarantine test: "Multiple sessions,Session overtaken by another" 🙋 manual
Quarantine test: "Recovery T2T1 - dry run,Recovery after partial recovery" 🙋 manual

Updated: 2026-06-01T16:01:49.480Z • 9 test(s) total

Trezor Suite (desktop) — 6 test(s)
Test Type
Passphrase with cardano > verify cardano address behind passphrase 🤖 auto
Cardano > Basic cardano walkthrough 🤖 auto
Public Keys > Check ada XPUB 🤖 auto
Account types suite > Add-account-types-non-BTC-coins 🤖 auto
Onboarding - create wallet > Success (basic) 🤖 auto
Quarantine test: "Multiple sessions,Session overtaken by another" 🙋 manual

Updated: 2026-06-01T15:59:33.084Z • 6 test(s) total

🌐 Preview deployments

🌐 Suite Web preview: https://dev.suite.sldev.cz/suite-web/copilot/fix-cannot-wipe-data-windows/web/

Copilot AI linked an issue Jun 1, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix cannot wipe data from Debug menu on Windows fix(desktop): release Electron storage locks before wiping user data on Windows Jun 1, 2026
Copilot AI requested a review from evgenysl June 1, 2026 15:58
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.

Cannot Wipe data from Debug menu on Windows

2 participants