[Bug]: Chrome profile import fails permanently after first interruption — stale .ego_data_import_stage files never cleaned up
Affected component
ego lite browser app
What happened?
If a Chrome-profile import is interrupted on the first attempt (e.g. the source Chrome profile's SQLite databases are locked because Chrome is still running in the background), the importer leaves behind staging artifacts named *.ego_data_import_stage in the ego lite profile data directory and never cleans them up. Every subsequent "Try again" click then fails immediately and silently — no console output, no entry in chrome_debug.log even with --enable-logging=stderr --v=1 and --vmodule="*import*=3,*profile*=2", and no user-visible reason beyond the generic "Import failed. Try again" button.
The only workaround I found is manually deleting the *.ego_data_import_stage files from ~/Library/Application Support/Citro Labs/ego lite/ before retrying — not something a typical user can discover on their own. Once import is interrupted once, it is effectively unrecoverable through the UI.
Steps to reproduce
1. Have Chrome running in the background (even a headless `--no-startup-window` instance kept alive by "continue running background apps") with a profile whose History/Login Data/Web Data SQLite files are open.
2. In ego lite onboarding, choose "Import from another browser" → Chrome → select that profile → click Import.
3. Import fails ("Import failed. Try again"). Root cause confirmed: `PRAGMA quick_check` on the profile's History/Login Data/Web Data returns "database is locked (5)" while Chrome is running, and passes cleanly once Chrome is fully quit.
4. Fully quit Chrome (verified no Chrome process running) and click "Try again" — import still fails.
5. Inspect `~/Library/Application Support/Citro Labs/ego lite/` — find leftover staging artifacts from the failed attempt:
- `Default.ego_data_import_stage/` (full staged profile directory)
- `Local State.ego_data_import_stage` (contains the `profile.info_cache` entry for the profile being created, e.g. `source_profile_dir_name: "Profile 4"`)
6. Manually delete both stale staging files/dirs, then click "Try again" — this time the import succeeds for that profile.
7. Repeat the whole flow for a second Chrome profile (already-unlocked this time): import still fails, and a new `Local State.ego_data_import_stage` leftover appears after each failed retry. Cleaning it up and retrying repeats the same failure with no progress — 4 attempts, same result, zero diagnostic output each time.
8. A filesystem watch (200ms polling) during a "Try again" click shows the retry doesn't even reach the point of spawning an import worker or touching the staging path — it fails before any observable side effect.Expected behavior
A failed/interrupted import attempt should either clean up its own staging artifacts automatically, or "Try again" should detect and clear stale staging files before retrying — not permanently block the profile from ever importing.
Version
- ego (lite) version: 0.4.5.5
Environment
macOS (Darwin 25.5.0)
Logs or screenshots
Additional context
Suggested fixes:
- On import start, detect and clean up any stale
*.ego_data_import_stageartifacts from a previous failed attempt before beginning a new import. - Log a specific, greppable reason when an import attempt aborts (e.g. "staging path already exists", "source database locked") instead of failing silently.
- Surface a more actionable UI message than "Import failed. Try again" — at minimum distinguish "source browser is running, please close it" from other failure classes.
Before submitting
- I searched the existing issues and did not find a duplicate.
- I removed secrets and sensitive browsing data from this report.
Source: citrolabs/ego-lite