Skip to content

fix: wire AbortSignal to osascript subprocess for clean cancellation#80

Closed
ErnestHysa wants to merge 1 commit into
nowork-studio:mainfrom
ErnestHysa:main
Closed

fix: wire AbortSignal to osascript subprocess for clean cancellation#80
ErnestHysa wants to merge 1 commit into
nowork-studio:mainfrom
ErnestHysa:main

Conversation

@ErnestHysa

Copy link
Copy Markdown

Fixes the AbortSignal not wired bug in pick-folder.ts. The osascript subprocess previously only had a 5-min hard timeout with no way to cancel it via AbortSignal. This change adds signal?: AbortSignal support to pickFolder and wires it to execFile for clean cancellation.

TheophilusChinomona added a commit to TheophilusChinomona/NotFair that referenced this pull request Jun 29, 2026
…er picker, --no-open precedence

Apply fixes from open upstream PRs that apply cleanly to our fork:

- AbortSignal (nowork-studio#80, ErnestHysa): wire signal? parameter through pickFolder
  and pickFolderMac to execFile, enabling clean cancellation of osascript.
  Also extend to the new Linux execDialog helper.

- Linux folder picker (nowork-studio#77, RohithVangalla1): implement pickFolderLinux using
  zenity (GTK) with kdialog (KDE) fallback, replacing the TODO stub.
  Linux users can now use the Browse button in the NotFair UI.

- --no-open precedence (nowork-studio#92, Osamaali313): extract the auto-open guard in
  bin/notfair-content-calendar into a _should_auto_open helper that checks
  --no-open before platform. Fixes macOS/Windows ignoring the flag.

Co-authored-by: Claude
TheophilusChinomona added a commit to TheophilusChinomona/NotFair that referenced this pull request Jul 8, 2026
…er picker, --no-open precedence

Apply fixes from open upstream PRs that apply cleanly to our fork:

- AbortSignal (nowork-studio#80, ErnestHysa): wire signal? parameter through pickFolder
  and pickFolderMac to execFile, enabling clean cancellation of osascript.
  Also extend to the new Linux execDialog helper.

- Linux folder picker (nowork-studio#77, RohithVangalla1): implement pickFolderLinux using
  zenity (GTK) with kdialog (KDE) fallback, replacing the TODO stub.
  Linux users can now use the Browse button in the NotFair UI.

- --no-open precedence (nowork-studio#92, Osamaali313): extract the auto-open guard in
  bin/notfair-content-calendar into a _should_auto_open helper that checks
  --no-open before platform. Fixes macOS/Windows ignoring the flag.

Co-authored-by: Claude
@ununununium

Copy link
Copy Markdown
Member

Thanks for the PR — declining this one, with reasoning:

  1. The parameter has no caller. The only call site is the POST /api/fs/pick-folder route, and neither it (nor this PR) passes a signal — so the change adds optional API surface with zero behavioral difference. The comment it removes ("we don't wire up an AbortSignal here; the DIALOG_TIMEOUT_MS ceiling protects against a wedged osascript") documents a deliberate decision, and we hold a hard line against speculative parameters in this repo.

  2. It targets the pre-rename tree. The app moved from notfair-cmo/ to notfair/ in 0.9.0, so the PR permanently conflicts with main as written.

What would be a welcome resubmission: the complete end-to-end version against notfair/src/server/fs/pick-folder.ts — wire request.signal from the route through pickFolder into execFile, so that when the user abandons the Browse click (tab closed, navigation), the orphaned osascript dialog is actually dismissed instead of lingering up to 5 minutes. That has observable behavior and a clear user benefit. Happy to review it.

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.

2 participants