Repository navigation
Conversation
Await staged and published ACL checks through asynchronous process execution, including the first SID lookup. Serialize and coalesce dismissal snapshots, preserve permission failure reporting, and drain pending writes through the existing bounded quit barrier. Co-authored-by: LDH1103 <ldh517525@gmail.com> Co-authored-by: Loom <loom@local>
Use a checked errno guard for both durability lanes and keep the unsupported-code set private. Exercise concurrent publication, failed writer recovery, fsync ordering, and cleanup on Windows as well as POSIX.
Co-authored-by: LDH1103 <ldh517525@gmail.com> Co-authored-by: Loom <loom@local>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change adds asynchronous secure-file writers with per-path serialization and optional durable syncing. Windows ACL hardening now resolves the current user SID asynchronously. Mobile notification dismissal records persist asynchronously, expose flush methods through the runtime, and are flushed within the bounded application quit teardown. The relaunch path now uses the normal quit pipeline after relaunch cleanup. Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: ⚪ Minimal · up to The test now waits for persistence before deleting its temporary state, so a persistence failure is less likely to be hidden. No merge-blocking risk is identified in this scoped change. 🚥 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 |
a22500b to
79c96ae
Compare
Await the existing shutdown flush in the shared host fixture and its mobile consumer, and replace restore-test polling with explicit write drains. Co-authored-by: LDH1103 <ldh517525@gmail.com> Co-authored-by: Loom <loom@local>
Reuse the existing bounded quit pipeline for renderer relaunch, retain pre-relaunch auth cleanup, and make relay recovery assertions await the asynchronous snapshot. Co-authored-by: LDH1103 <ldh517525@gmail.com> Co-authored-by: Loom <loom@local>
Await persistence before recovery reads and replacement-controller startup, and drain fixture hosts after their producers stop before removing test state. Retain original delivery fences and unseen-prompt assertions. Co-authored-by: LDH1103 <ldh517525@gmail.com> Co-authored-by: Loom <loom@local>
Avoid swallowing a missing-path persistence failure while the read-retirement retry test removes its independent relay directory. Co-authored-by: LDH1103 <ldh517525@gmail.com> Co-authored-by: Loom <loom@local>
|
Closing as superseded by current main ( The core notification fix is already present: The dismissal-loss boundary is covered too. Normal quit waits for both structured-session teardown and RPC stop before closing dismissal persistence. Relaunch explicitly awaits This PR instead switches relaunch to the normal quit pipeline and introduces another general secure-writer/serialization lane. That is a different lifecycle choice, but its reported dismissal-preservation requirement is already handled. The original Windows before/after measurements do not establish a remaining gain over today's implementation. Under the performance bar in #27143, the extra writer and obsolete subprocess machinery have no demonstrated remaining benefit that justifies carrying this PR forward. This closure is based on the implemented replacement, not merge conflicts. Preserving the branch and its Windows evidence for reference. |
ELI5
Windows notification saves now run in the background, so permission tools do not hold up unrelated Orca work. Restarting from settings also uses the existing bounded shutdown path so pending dismissal history can finish saving before the process exits.
What Changed
The shared asynchronous secure writer serializes each destination, checks temporary-file permissions before rename, verifies the published file, preserves optional durability, and removes temporary files after thrown failures. Notification dismissal snapshots coalesce changes and report write/permission failures; unreadable history is preserved. The first asynchronous Windows user-SID lookup shares successful results with the existing synchronous lane.
app:relaunchnow usesquitProcess(), as administrative restart and profile switching already do. Its existing auth cleanup still finishes first. The existing quit pipeline stops structured-session and RPC producers, drains notification persistence, and enforces its existing 20-second teardown deadline; tray cleanup runs there too. Recovery fixtures, including the standalone relay retry case, now drain pending snapshots before opening replacement controllers or reading disk, and stop their producers before draining/removing test state.Why
This preserves the existing permission checks and retry policy while moving notification writes off the main thread. Reusing the quit pipeline fixes a captured relaunch loss without a second shutdown system or an unbounded flush. Existing synchronous APIs and consumers remain available; the writer and notification consumer already occupy separate modules, so another PR split would not remove their shutdown dependency.
Adapted bounded portions of LDH1103's #24029 (
a1a2438,47e0fa2) and llvm-x86's #20498 (8d44d96). Published follow-ups preserve ancestry and the exact coauthor trailersLDH1103 <ldh517525@gmail.com>andLoom <loom@local>.Linked Issue
Fixes #26027. Refs #20497.
This removes the reproduced notification write blocking mechanism; it does not establish that the reported multi-second agent-prompt workload freeze or #11363 is fully resolved.
Visual Proof
Windows relaunch boundary, before at
1296bc1e44fand after at exact final head17cf9ab1ea7f0169aba8f7726322c8ce2c18a506:A hidden offscreen Electron harness uses the actual renderer restart preparation, IPC handler, quit pipeline, dismissal store, secure writer, ACL/SID code, and auth-preservation orchestrator. Playwright CDP clicks its rendered Relaunch button; Electron exits and actually launches its replacement. Injected 750ms rename delay and a final producer dismissal reproduce the boundary loss. The after transcript shows the producer's final dismissal, persistence drain, then exit. Auth/profile services use synthetic file-backed markers; these images are diagnostic results, not a full settings UI or live account test. No window was revealed or activated.
Earlier Windows write-path timing evidence remains:
Prior exact-source probes measured native
record()at 79–117ms before versus 0.08–0.29ms after; the hidden Electron probe measured 117.37ms versus 0.17ms. The separately labeled 250ms-per-spawn injection measured 1,411ms versus 0.07ms. These establish the blocking mechanism, not the user's complete agent-prompt workload.Testing
17cf9ab1ea7f0169aba8f7726322c8ce2c18a506tested on real Windows (awin, Node v24.18.0, pinned Bun 1.4.2), isolated cloneC:/opr54risk: 22 files, 196 passed / 16 platform skips in one explicit run; fullpnpm tcand full PR changed-code quality pass.pnpm tcand original-base changed-code quality pass, zero new findings across 26 PR-changed files.37890983176had nine introduced fixture failures across shards 1–3: one queued-frame disk read, one replacement-controller startup, and seven immediate relay snapshot reads. All were reproduced before correction; explicit persistence drains retain the original identity, unseen-prompt and completion assertions. Theverifyfailure only aggregates the failed test jobs. Static/mobile/package/Windows-package/relay-integration jobs and shards 4–5 passed on that older head.ORCA_BACKGROUND_LAUNCH=1; hidden renderer screenshots used Playwright CDP. Local generated diagnostics were excluded from quality scans; every committed production/test file was scanned. Initial Windows missing-Bun and shallow-merge-base setup failures were corrected before passing runs.Full local repository test/lint/build, Linux/SSH end-to-end, live account credentials, WSL auth promotion and native focus were not exercised. New-head CI must still run.
Review
Reviewed temporary/published permission ordering, false/error outcomes, serialization cleanup, consumer recovery boundaries, producer-before-drain ordering, renderer capture/veto contracts, profile/auth sequencing and shutdown deadlines. The relaunch follow-up changes one production handler and seven test/fixture files, preserving original authorship and existing runtime APIs.
Agent skill upstream boundary
Notes
Persistence remains best-effort. Crashes, OS termination, other direct forced-exit paths, write/ACL failures and expired shutdown deadlines can lose queued history. ACL failures preserve the existing publish-and-return-false contract. The writer requires one path spelling and one write lane per destination; path aliases and mixed sync/async writers are not coordinated. Other synchronous IPC/startup paths remain outside this change.
Notification identity and folder workspace recovery assertions remain intact. Persistence belongs to the execution host; RPC/notification fields are unchanged for mixed-version peers. Renderer preflight already requests editor hot-exit backup and a durable checkpoint; normal quit now also uses the existing duplicate-capture and veto guards. Degraded startup retains its hydration gate so failed restore cannot overwrite saved sessions.
Checklist