Repository navigation
Warn on slow profile saves instead of failing them - #26447
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (15)
💤 Files with no reviewable changes (2)
🚧 Files skipped from review as they are similar to previous changes (6)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe profile-state writer now treats slow requests and worker-exit waits as warnings rather than request deadlines. Main-process and renderer APIs report delayed-save status, and the app shell displays a localized warning. Persistence listeners now select pane-alias and migration domains for scoped saves. Tests cover writer stalls, shutdown waits, delay notices, and selective persistence. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to Slow saves now warn while the write continues, and the warning clears when the save completes or fails. No actionable merge-blocking risk was identified. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the problem, solution, mechanism, and automated testing, but required information is incomplete. No issue is linked, visual proof remains TODO, platform testing is unspecified, AI disclosure is incomplete, and required checklist items and validation results are not confirmed. Resolution Link the applicable issue after Full details: Docstring CoverageExplanation Docstring coverage is 28.95% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 38 functions across 36 files. (6 skipped: 6 unsupported.)
✨ 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 |
8a0ebca to
a2b3d02
Compare
Profile-state writes used to fault after 30 seconds. A stalled main loop or a slow disk could then drop the writer and show a "could not confirm your save" dialog, even when the write was still in progress. Slow requests now record a diagnostic breadcrumb and keep waiting for the worker's reply. Close waits for the worker to actually exit, and a termination request alone no longer counts as proof. Pane-alias and migration-listener changes now save only their own sections, not a full state rebuild. Quit teardown also keeps the profile admission held until the final flush finishes, so a pending write is no longer released early at the deadline.
Slow profile-state writes used to leave only a diagnostic log entry, so users had no way to tell that recent changes were not yet confirmed saved. The writer now reports when a save write passes the slow-warning threshold and reports recovery when the reply arrives. Writes are never failed or retried because of the delay. - Main keeps the current delayed/healthy status and publishes changes to the renderer, so a reopened window gets the correct state. - The renderer shows one persistent warning toast while a save is delayed and dismisses it on recovery. - Observer errors are logged and do not interrupt saving. - The web build reports saving as healthy because it does not use the desktop profile writer.
The save-delay warning used one fixed toast ID. Sonner applies a dismissal a frame late, so a dismissal could remove a warning that had just been shown again with the same ID. The hook now tracks the ID of each delayed-save warning it shows and dismisses only that toast. A new delay gets a fresh ID. Add Sonner-level tests for remount, StrictMode cleanup, and recover-then- delay races. Harden the e2e spec with a paused clock and a retry around main-process evaluate.
Revision checks and JSON exports run on the same profile-state worker as saves, so a slow one holds up later writes just like a slow write does. The save-delay warning only tracked write-* commands, so those stalls went unreported. Every command except initialize and close now raises the warning. Tests cover the export-latest path and assert the delay signal fires once with true before clearing.
The delayed-save warning said recent changes were not yet confirmed saved, which overstated the risk while Orca was still retrying. The real condition is a slow profile-state write, so the toast now names profile storage and says later saves may wait until that operation finishes. The copy is updated in every locale, and the unit and e2e tests that assert it are updated to match.
a2b3d02 to
2e3a479
Compare
#26447 pushed src/main/ipc/app.ts one line over the 300-line limit, so main's oxlint is red and merges from main fail the commit hook. Move the keyboard input-source probe and its bounded command runner, unchanged, into macos-keyboard-input-source.ts beside the other macOS keyboard probes.
Picks up upstream's profile-state writer fixes (stablyai#25318, stablyai#26444, stablyai#26447). Brings the offscreen-page file drop, iroh SAFETY/device-grant cleanups and extension e2e typing in line with their current PR branches. Claude-Session: https://claude.ai/code/session_01DvNJ16LEPYmdEkpQWtDL7n
Problem
Orca saves profile data through a background writer. If a save took longer than 30 seconds, Orca treated it as failed, showed an error, and refused new saves until restart. A slow disk or a sleeping laptop could therefore block later changes even though the write was still in progress.
Solution
A slow save now shows a warning notice instead of failing. Orca keeps waiting for the save, clears the notice when it finishes, and reports a failure only for a real writer error or exit. Pane alias and migration data also save on their own, so small updates no longer rewrite the whole profile.
What Changed
profile-state-writer-deadline.ts). A one-shot slow warning replaces it (profile-state-writer-slow-warning.ts).Why
A timer cannot tell a stuck writer from a slow one, so failing on the timer produced false data-loss reports. Warning and waiting keeps the save path honest, and the user still sees that saving is delayed. Alternatives not taken: raising the timeout (still fails eventually) and retrying the write (risks duplicate writes with an unknown outcome).
Linked Issue
No issue linked.
Visual Proof
TODO: attach before and after screenshots or a video of the save-delay notice. The e2e spec
tests/e2e/profile-state-save-delay.spec.tscaptures a screenshot of the notice.Testing
Automated tests added or updated: writer slow-warning and close tests, alias and migration selective-save tests, renderer notice tests (unit and Sonner), startup save-delay and quit tests, and an Electron e2e spec. Local runs are not confirmed yet.
Platforms actually tested: TODO
AI Disclosure
TODO
Review
Agent skill upstream boundary
Notes
Ensure no issues in: Security, Cross-platform (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance. TODO: confirm each.
This is a partial fix. It removes the false failure for slow saves, but a save that never completes now warns indefinitely instead of failing. No issue is linked, so nothing is closed automatically.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)