Repository navigation
fix: correct SQLite file URIs on Windows - #1868
Conversation
|
Hey, thanks for the PR. Could you sign the CLA when you get a chance so we can review it? |
Happy to sign! Could you share the CLA signing link? The license/cla check currently shows "Expected" without a link. |
|
Thanks! I've now signed the CLA as 0xMrMasry, and CLA Assistant showed the confirmation: "Thank you 0xMrMasry for signing the CLA!" The PR still appears to be waiting for |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
AbirAbbas
left a comment
There was a problem hiding this comment.
Verified, including natively on Windows: cross-compiled test binaries run on Windows pass at this head (drive, forward-slash, UNC and special-character paths, pragmas kept, read-only doesn't create a missing DB), and the same automation test built from dev fails with the original SQL logic error: out of memory (1). On Linux the URIs are byte-identical to what dev produced for spaces, #, &, %, ?, unicode and backslashes, so POSIX users see no change. I added those cases as tests and merged current dev. A few other openers still build URIs by hand; that's pre-existing and filed separately. Thanks!
What changed
On native Windows, a fresh
codeaflaunch disables memory, conversation search, and automations withSQL logic error: out of memory (1). The database openers passnet/url.URLa Windows drive path, producingfile://C:%5C.... SQLite rejects that URI before opening a database. With the same driver and machine,:memory:, a plain filename, andfile:///C:/...all open successfully.Add a shared file-URI constructor that uses forward slashes and a rooted URL path, then use it in the graph, automation, collection, and read-only plan-preview database openers. POSIX absolute paths keep their existing URI shape, and query parameters remain with each caller. The regression test exercises persistence at the requested filename with spaces,
#,&, and%, connection pragmas, and read-only access.Related to #1082. This addresses database opening; the separate Windows resume/presence-locking problems remain outside this change.
How it was checked
On Windows amd64 with Go 1.26.5 and the repository's modernc.org/sqlite v1.29.1:
go test ./internal/automation -run '^TestStoreRefusesAForeignDatabase$' -count=1fails with the reported SQLite error.git diff --checkpasses.go vet ./internal/sqliteuri ./internal/store ./internal/automation ./internal/workspace ./internal/plandbpasses.make changelog-checkpasses, including the entry for fix: correct SQLite file URIs on Windows #1868.make pr-readypassesgo build ./...and then fails atgo vet ./...because unmodified tests use Unix-onlysyscall.Setpgid,syscall.Kill, andsyscall.Flock, and other unmodified test helpers/packages are excluded on Windows. The full local gate therefore does not pass.Checklist
.github/known-red.txt.