Skip to content

refactor(app): use sandbox-compatible paths in AppPaths#28

Merged
pasrom merged 3 commits intomainfrom
refactor/sandbox-paths
Mar 15, 2026
Merged

refactor(app): use sandbox-compatible paths in AppPaths#28
pasrom merged 3 commits intomainfrom
refactor/sandbox-paths

Conversation

@pasrom
Copy link
Copy Markdown
Owner

@pasrom pasrom commented Mar 15, 2026

Summary

  • Replace hardcoded homeDirectoryForCurrentUser-based paths with FileManager.urls(for:in:) API
  • dataDir now uses applicationSupportDirectory which automatically resolves to the sandbox container path
  • Move ipcDir under dataDir/ipc instead of ~/.meeting-transcriber/ (no longer needs a separate dotdir in $HOME)
  • Remove private home property

Test plan

  • swift build compiles
  • swift test — all 491 tests pass
  • ./scripts/lint.sh — 0 violations
  • Manual: verify paths resolve correctly outside sandbox (same as before)

What: Replace hardcoded home-relative paths with FileManager.urls API.

Reasoning:
- Problem: Hardcoded ~/Library/... and ~/.meeting-transcriber/ paths
  break inside an App Sandbox container
- Decision: Use FileManager.urls(for:in:) which automatically resolves
  to the sandbox container path when sandboxed, same path otherwise.
  Move ipcDir under dataDir instead of a separate dotdir in $HOME.
@github-actions github-actions bot added the chore Maintenance or non-functional changes label Mar 15, 2026
pasrom added 2 commits March 15, 2026 21:24
Without migration, the app loses track of previously processed
recordings when ipcDir moves to dataDir/ipc, causing old recordings
to be re-queued through the pipeline.

Uses try/catch with specific CocoaError cases instead of fileExists
guards to avoid TOCTOU. Logs migration success/failure.
@pasrom pasrom force-pushed the refactor/sandbox-paths branch from 3471e35 to c2ddd09 Compare March 15, 2026 20:36
@pasrom pasrom merged commit e06baa7 into main Mar 15, 2026
5 checks passed
@pasrom pasrom deleted the refactor/sandbox-paths branch March 15, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance or non-functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant