Fix custom output directory not persisting in non-sandboxed builds#497
Fix custom output directory not persisting in non-sandboxed builds#497igorlenskiii-web wants to merge 1 commit into
Conversation
Security-scoped bookmarks require the App Sandbox. The direct (non-App-Store) build is not sandboxed, so bookmarkData(options: .withSecurityScope) throws there; the `guard try?` in setCustomOutputDir swallowed that error, the chosen folder silently never persisted, and output always fell back to ~/Downloads/MeetingTranscriber while the Settings UI kept showing the selected path. Fix: try the scoped bookmark first (APPSTORE build), fall back to a regular bookmark, mirror the same fallback when resolving, and log a creation failure instead of silently returning.
|
Thanks for digging into this and for the clean, well-documented change. The symptom you describe (custom output folder shows in the UI but recordings keep landing in I could not reproduce the scoped-bookmark throwThe stated root cause is that
In all of them Why that matters for this diffBecause the scoped-create branch succeeds on the direct build, A likelier cause to check
What I would happily take from this PR regardless
The one thing that needs to change before this could merge is the doc comment on Appreciate the contribution; let's confirm the repro and I think we land the useful parts of this quickly. |
Symptom
Settings → Output → choosing a custom output folder appears to work (the UI shows the selected path), but nothing persists: every new recording writes to the default
~/Downloads/MeetingTranscriber/again, and the folder is silently recreated there. Observed on the Homebrew/direct build v0.6.0-rc6, macOS 26.5.Root cause
AppSettings.setCustomOutputDirstores the folder as a security-scoped bookmark:Security-scoped bookmarks require the App Sandbox. The direct (non-App-Store) build is not sandboxed (it can't be — CATap capture), so
bookmarkData(options: .withSecurityScope)throws, theguard try?swallows the error, and the setting is never written.effectiveOutputDirthen falls back toAppPaths.downloadsProtocolsDirforever, while the Settings UI keeps displaying the user's chosen path.Fix
makeOutputDirBookmark/resolveOutputDirBookmarkhelpers..withSecurityScopefirst (APPSTORE build keeps its behavior), fall back to a regular bookmark for the non-sandboxed build, and log an error instead of failing silently..withSecurityScope→ plain), so both bookmark kinds resolve regardless of which build wrote them.AppSettings+RPC.rpcOutputDirPathneeds no change — it already resolves with[.withoutUI, .withoutMounting], which works for both bookmark kinds.Testing
Reproduced the symptom on macOS 26.5 with the rc6 direct build (chosen folder shows in UI, files keep landing in
~/Downloads/MeetingTranscriber). The patch was reviewed against the existing style but not compiled locally — relying on CI (unit tests + E2E) to exercise it; happy to adjust if anything trips.🤖 Generated with Claude Code