Repository navigation
Release cookie snapshots when import preparation fails - #26218
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughChromium cookie-import preparation now uses shared cleanup for unsuccessful exits. It closes open databases, removes staged database files and sidecars, and cleans up the source snapshot. Successful preparation transfers resource ownership to the returned context. New tests cover refusal and error cleanup, successful imports, and staged-database retention during replay. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The change appears ready to merge after normal checks; no remaining cleanup failure has been established. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ELI5
A failed browser-cookie import left a private copy of the browser’s cookie database on disk. Every retry could leave another copy. Orca now removes the copies owned by an import that stops during preparation.
What Changed
Preparation owns its source snapshot and staging database until it returns a successful import context. A
finallyblock closes both private databases and removes their files on empty-source, unreadable-partition, denied-key, and preparation-error exits. Successful preparation transfers ownership to the existing importer, including a staged database needed for restart replay.Why
The importer could clean up only after preparation returned a context. Earlier exits lost the source snapshot’s cleanup callback. Keeping cleanup with its current owner fixes that gap without a directory sweeper, new cache, or changes to cookie selection and retry policy.
The actual Chromium importer with a generated 1,000-cookie SQLite database and live WAL left 12,583,080 bytes in three private snapshot directories after three denied-key attempts. The fix leaves zero. The single-cookie control went from 49,208 bytes to zero. Measurements use generated cookie values and a mocked denied credential response; they measure persistent files, not typing latency or CPU.
Linked Issue
No existing issue; maintainer performance audit.
Visual Proof
N/A — private temporary-file cleanup; the import result and browser interaction remain the same.
Testing
Six regression tests exercise real SQLite databases and private snapshot copies through the existing importer seams. Four fail on the original source and all six pass with the fix. They cover empty and denied-key imports, an unreadable cookie partition, a thrown schema error, ordinary completion, and retained restart replay. The error case observes both private database handles closed before snapshot removal.
pnpm tc:node, focusedoxlint, formatting, and changed-code quality gate pass.pnpm tcpasses and the 93-file changed-code quality gate reports no new findings.ORCA_BACKGROUND_LAUNCH=1. No native credential prompt or app window was opened. Hosted macOS/Windows packaging, static analysis/typecheck, relay integration and all five Node24 test shards passed. One Ubuntu ARM shard initially lost communication with GitHub’s server; the failed jobs passed on retry without a source change.Review
Independent source review confirmed cleanup order and successful-context ownership, including restart replay. Only preparation and its new regression test change. Paths and cleanup retries reuse the existing cross-platform implementation. This host-local browser import adds no SSH execution or wire-protocol behavior.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Successful imports retain their existing cleanup and restart fallback. Failed preparation removes only its own private copies.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)