Skip to content

Fix: URL-encode spaces in database path for macOS#15

Merged
GigaChadGRC merged 1 commit intomainfrom
fix/db-path-space-encoding
Mar 4, 2026
Merged

Fix: URL-encode spaces in database path for macOS#15
GigaChadGRC merged 1 commit intomainfrom
fix/db-path-space-encoding

Conversation

@chadfryer
Copy link
Collaborator

Summary

One-line fix: URL-encode spaces in the DATABASE_URL passed to the Node.js sidecar.

Root cause

macOS stores app data at ~/Library/Application Support/ — note the space. The v0.2.1 fix correctly copies the database there, but passes the raw path to Prisma via DATABASE_URL=file:/path/Application Support/dev.db. Prisma's URL parser rejects the unencoded space, causing every database query to fail silently. The library API returns a 500 error, and the UI shows "No sessions available."

Fix

// Before
.env("DATABASE_URL", format!("file:{}", db_path.display()))

// After  
.env("DATABASE_URL", format!("file:{}", db_path.display().to_string().replace(' ', "%20")))

Bumps to v0.2.2.

macOS app data lives at ~/Library/Application Support/ which contains
a space. Prisma's file: URL parser rejects unencoded spaces, causing
the library API to fail with "Failed to load library." Bump to v0.2.2.
Copy link
Contributor

@GigaChadGRC GigaChadGRC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@GigaChadGRC GigaChadGRC merged commit 978c098 into main Mar 4, 2026
2 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.

2 participants