Skip to content

Find the relocated Things database when the old path is a stub - #5

Merged
mattt merged 4 commits into
mainfrom
mattt/fix-database-discovery
Oct 29, 2026
Merged

mattt merged 4 commits into
mainfrom
mattt/fix-database-discovery

Conversation

@mattt

@mattt mattt commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Resolves #4

On some Macs, the old Things Database.thingsdatabase path in the Things group container is a small text file that points to the relocated library, not a bundle. Discovery found the nested ThingsData-* library, but the check for main.sqlite below the stub failed with ENOTDIR. Every error other than "not exist" was reported as database_access_denied, with advice to grant Files & Folders access.

This PR treats a file at the old bundle path as absent, shows the privacy advice only for permission errors, and reports other failures as database_unreadable with the underlying error. The database_missing message now names the folder it searched.

It also adds a THINGS_DATABASE environment variable that selects a database when the arguments are hard to change, such as in an MCP client configuration. --database takes precedence, and writes still require the discovered library.

mattt added 3 commits October 29, 2026 05:07
A regular file at the old bundle path made the stat fail with ENOTDIR, which Discover reported as a privacy error. Treat that as an absent library, show the Files & Folders advice only for permission errors, and return database_unreadable with the path for other failures.
MCP clients that cannot change arguments can set the variable. The --database flag takes precedence. Write checks still compare against the discovered library, so a different path stays read-only.
@mattt
mattt merged commit 1763190 into main Oct 29, 2026
1 check passed
@mattt
mattt deleted the mattt/fix-database-discovery branch October 29, 2026 12:39
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.

Misleading database_access_denied when the DB is actually just not auto-detected (relocated Things 3 DB)

1 participant