Skip to content

fix: hand off native macOS reopen requests during confirmed quit - #567

Merged
guo9310 merged 7 commits into
mdiri-ai:mainfrom
codezzzsleep:fix/native-quit-requests
Nov 21, 2026
Merged

guo9310 merged 7 commits into
mdiri-ai:mainfrom
codezzzsleep:fix/native-quit-requests

Conversation

@codezzzsleep

@codezzzsleep codezzzsleep commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

During a confirmed quit, macOS Finder file requests and Dock activation still reach the exiting process through open-file and activate. The previous handlers queue files or reveal windows in that process, so the application can exit with the new request lost.

Route both paths through the existing quit-relaunch.deferLaunch state. Requests contribute to one bounded, deduplicated handoff at the final will-quit boundary; a later activation retains earlier files. Cold startup, ordinary running requests and declining the exit confirmation keep their existing behavior.

Fixes #563.

Validation uses the current-main merge: main 3134d8a6, PR head 1739592f, merge c0da08cb, tree da8c1e5d.

  • Node 22.23.5 / Electron 44.9.3: the ten native-request regressions reproduce five failures on current main and all pass with this repair. The focused lifecycle/file-open/authentication suite passes 153 tests with one existing Windows-only skip; the full client suite passes 10,273 tests with 49 existing skips and zero failures. Public source, repository layout, third-party, docs, HTML, pinned secret, syntax and diff checks pass.
  • All 12 upstream PR checks succeeded on the current published head 1739592f, including Linux/Windows clients, macOS HTTP startup and Runner TLS/cleanup, backend acceptance and PostgreSQL migration/backup/restore.
  • Actual macOS 26.7.2 arm64 acceptance ran an installed diagnostic DMG with the production main/preload/renderer and utilityProcess runtime, a genuine local Qwen 0.6B inference server, native Finder/Dock requests and the native quit dialog. Product files and dependency lockfile match merge c0da08cb; observer wrappers call the original methods without synthetic app events or artificial cleanup delays. Packaging uses the unchanged committed npm lockfile and public beforePack pipeline, with an ad-hoc signature verified by codesign.
Native case Observed result
Decline quit Same process and actual inference stay active; Finder file acknowledgement and Dock activation work; no restart is scheduled. A later normal confirmed exit succeeds.
Finder file during confirmed quit One fresh process receives and acknowledges the requested file; exiting workspace stays hidden.
Dock during confirmed quit One fresh process starts with no contributed files.
Repeated files followed by Dock One fresh process retains two unique files and acknowledges each once.
Twenty-file cap Finder delivers 25 actual file events during the confirmed-quit interval. PID 33375 schedules one relaunch to PID 47284; exactly the first 20 files are forwarded, claimed and acknowledged once. Earlier startup files are not replayed, and the saved account, encrypted model reference, Hub selection and workspace remain usable.

Native evidence is available in the fork Actions logs: detailed cancellation, four completed native cases, and complete twenty-file acceptance. The diagnostic test scaffolding is pinned at 70ff3ae5; the earlier four-case source 011b0cb9 has identical product files.

Evidence limits: the four-case worker reached every assertion and printed each success, then timed out in its unfinished budget case before detailed aggregate logging; the remaining budget was completed independently on identical product code with full traces and screenshots. The final fork Mac job completed all native setup/acceptance stages, then failed an unrelated workflow-consistency assertion because its preserved older workflow tree lacks client-packages.yml; that full fork workflow is not a passing CI run. The current upstream PR has 12 successful checks. Developer ID notarization, official signed-release distribution and Intel Mac were not tested.

Compatibility: the effective current-main product diff adds only the native reopen routing. Persisted fields, version-1 file envelopes, authentication hooks, dependencies, limits, startup/profile arguments and cleanup policy retain their existing formats and behavior. Normal source/packaged requests keep authorization and private-snapshot handling; native relaunch acceptance verifies continued use of the existing saved profile and model configuration.

The native arm64 source acceptance is complete and this PR is ready for maintainer review. No upstream merge or production deployment is claimed.

Signed-off-by: Ci Nie <codezzzsleep@gmail.com>
Signed-off-by: Ci Nie <codezzzsleep@gmail.com>
Signed-off-by: Ci Nie <codezzzsleep@gmail.com>
@codezzzsleep

codezzzsleep commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor Author

CI and native acceptance follow-up for head f98c35aa349cedc28590869d4affbebf21fe19a6: 11 of 12 checks succeeded. The macOS HTTP startup job was cancelled before obtaining a runner (runner_id: 0, no steps). GitHub reports hosted macOS arm64 capacity constraints. An upstream maintainer can rerun it from Actions or with gh run rerun 44568771400 --repo mdiri-ai/SoduWork --failed.

This PR stays draft pending native acceptance. The source HTTP job and the synthetic native-event probe do not establish Finder/Dock behavior. Target-platform acceptance on the PR's current-main merge needs an isolated profile and a real execution still shutting down after quit confirmation:

  • Finder opens one file, then multiple files, during confirmed quit.
  • Dock activation during confirmed quit restarts the application.
  • File opens followed by Dock activation preserve the contributed files.
  • Repeated opens deduplicate paths; the old process never reveals its workspace.
  • Exactly one fresh process receives each unique file once; prior startup files are not replayed.
  • A declined quit leaves ordinary file-open and activation behavior working.

Record macOS and Electron versions, the tested source/merge commit, old and new process IDs, and the observed file outcomes. A Linux host is the only available local execution environment in this session, so native Mac and running-model acceptance remain outstanding.

Update: the author has now pushed a source-identical signed-off CI retry commit, 89c76f6186734d283fefc3975604baa4b216e80f, after hosted Mac runners became available in #570. The entire source tree and actual current-main merge tree are unchanged. This ordinary fork push triggers new current-head checks without changing product code, workflow contents or assertions; the old cancelled jobs above remain retained evidence. The new current-head suite has now completed: 12/12 SUCCESS. Both Mac matrix scopes executed successfully; the original cancelled jobs above remain historical evidence.
Native Finder/Dock and running-model acceptance remain outstanding; this PR stays draft even if the source CI becomes green.

Signed-off-by: Ci Nie <codezzzsleep@gmail.com>
Signed-off-by: Ci Nie <codezzzsleep@gmail.com>
Signed-off-by: Ci Nie <codezzzsleep@gmail.com>
@codezzzsleep
codezzzsleep marked this pull request as ready for review November 21, 2026 00:06
Copilot AI balanced review requested due to automatic review settings November 21, 2026 00:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@guo9310
guo9310 merged commit 457481b into mdiri-ai:main Nov 21, 2026
12 checks passed
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.

Native macOS reopen requests bypass the confirmed-quit handoff

3 participants