Skip to content

Keep a database handle when the File Provider domain is unusable (fix post-update sign-in)#23

Merged
alexmodrono merged 1 commit into
mainfrom
fix/db-handle-post-update
Jun 5, 2026
Merged

Keep a database handle when the File Provider domain is unusable (fix post-update sign-in)#23
alexmodrono merged 1 commit into
mainfrom
fix/db-handle-post-update

Conversation

@alexmodrono

Copy link
Copy Markdown
Owner

Summary

Signing in right after a Sparkle update failed with "Database error: database not available". A normal relaunch worked.

Root cause (confirmed from app logs): after Sparkle replaces the bundle, macOS temporarily disables the File Provider extension. On that first launch NSFileProviderManager.stateDirectoryURL() throws, and that throw propagated out of configureInitialDatabase, so database was left nil — loadAccounts bailed (no session), and persistSignIn threw "Database not available". On a later manual relaunch the extension is re-enabled, so it worked.

Fix

configureInitialDatabase now always opens the App Group bootstrap database first (it doesn't depend on the File Provider domain), then tries to upgrade to the shared state-directory database. So the app always has a working handle; the session bootstrap re-seeds + adopts the shared DB once the extension is back. persistSignIn also opens a bootstrap handle if none is active, as a backstop.

This is a pre-existing fragility in the original 0.2.0 code. Note: the 35→36 update itself exercises the fix (the post-update launch runs build 36's code).

Build

Compiles clean.

Right after a Sparkle update macOS temporarily disables the File Provider extension, so NSFileProviderManager.stateDirectoryURL() throws on the first launch. That throw propagated out of configureInitialDatabase, leaving the app with no database handle: loadAccounts bailed (no session activated) and sign-in failed with "Database not available" — only on the post-update launch; a later manual relaunch (extension re-enabled) worked.

Always open the App Group bootstrap database first, then try to upgrade to the shared File Provider state database. The bootstrap database doesn't depend on the domain, so the app always has a working handle; the session bootstrap re-seeds and adopts the shared database once the extension is back. persistSignIn also opens a bootstrap handle if none is active, as a backstop.
@alexmodrono alexmodrono merged commit bd2cc12 into main Jun 5, 2026
@alexmodrono alexmodrono deleted the fix/db-handle-post-update branch June 5, 2026 14:02
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Nightly Build

Download Findle Nightly (unsigned)

Built from 17d0bfc.

Important

This build is unsigned. macOS will block it on first launch. To open it:

  1. Try to open the app normally — macOS will show a warning and refuse.
  2. Go to System Settings → Privacy & Security, scroll down, and click Open Anyway.
  3. The File Provider extension requires code signing and won't work in this build.

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.

1 participant