Skip to content

macOS: import the official app's store into the fork build (#39)#40

Merged
ryanbr merged 1 commit into
mainfrom
fix-macos-db-path
Jul 7, 2026
Merged

macOS: import the official app's store into the fork build (#39)#40
ryanbr merged 1 commit into
mainfrom
fix-macos-db-path

Conversation

@ryanbr

@ryanbr ryanbr commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What #39 reported

Installing 8.3.2 on macOS over 8.2.x opens an empty database — all data appears lost. Old path ~/Library/Containers/com.noopapp.noop/Data/…/OpenWhoop; new path ~/Library/Application Support/OpenWhoop.

Root cause

The v8.3.0 719477a8 "NOOP Staging identity" rename set the macOS bundle ID to com.noopapp.noop.staging so the fork installs beside the official app. But StorePaths.macOSProductionContainerAppSupport pins the store to the sandbox container only for the exact production ID com.noopapp.noop; under .staging it uses the plain ~/Library/Application Support/OpenWhoop, and the existing migrateLegacyStoreIfNeeded (gated on containerAppSupport != appSupport) never runs. So a user coming from the official app reads a fresh, empty directory.

The data was never deleted — it's still in the official app's container.

Fix — keep .staging, copy the official store in

Rather than flip the bundle ID (which would make the fork replace the official app), keep the beside-install .staging identity and copy the official com.noopapp.noop container store into the fork's store on first launch:

  • Copy, never move — the official app may still be installed and using it.
  • Runs only when the fork's store is still empty (same destinationHasData guard as the existing migration), so it never clobbers a fork user who already has data.
  • The distributed macOS build is unsigned (CODE_SIGNING_ALLOWED=NO in fork-release.yml), so it isn't sandboxed and can read the sibling container. If a sandbox is ever unexpectedly engaged, homeDirectoryForCurrentUser points inside our own container and the official store is unreachable → we bail rather than guess.

Who is affected, and what happens

  • Coming from official / fork v8.2.x (data in the container, fork store empty) → store copied in, data reappears. ✓ (the reporter)
  • Fork v8.3.x-only (data already in the plain path) → store non-empty → skipped, keeps working. ✓
  • Data in both (older container + newer fork data) → keeps the fork data (never clobbered); the container copy is skipped. Nothing deleted; the container remains for manual recovery.

No bundle-ID / identity change; the fork stays "NOOP Staging" beside the official app. Swift-only change; CI build dispatched to verify (can't compile Swift locally).

Fixes #39.

The fork ships a ".staging" macOS build that installs BESIDE the official app, so
its SQLite store lives at the plain ~/Library/Application Support/OpenWhoop, not
the official app's sandbox container. A user moving from official NOOP to the fork
therefore saw an empty database — their data was never deleted, just orphaned in
~/Library/Containers/com.noopapp.noop/Data/…/OpenWhoop (#39).

Keep the .staging identity (beside-install intent) and instead COPY the official
container store into the fork's store on first launch (our store still empty).
COPY, never move — the official app may still be installed and using it. The
distributed build is unsigned, so it isn't sandboxed and can read the sibling
container; if a sandbox is unexpectedly engaged we bail rather than guess. Reuses
the same empty-destination guard as migrateLegacyStoreIfNeeded, so it never
clobbers a fork user who already has data.

Fixes #39.
@ryanbr ryanbr force-pushed the fix-macos-db-path branch from e4c3c60 to 53fcb28 Compare July 7, 2026 13:13
@ryanbr ryanbr changed the title macOS: restore production bundle ID so data path is stable (#39) macOS: import the official app's store into the fork build (#39) Jul 7, 2026
@ryanbr ryanbr merged commit 92a7600 into main Jul 7, 2026
4 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.

While installing 8.3.2 on MacOs - I got a fresh setup (empty Database) !

1 participant