Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

fix(storage): sanitize preview channel db filenames#16398

Open
2asoft wants to merge 1 commit intoanomalyco:devfrom
2asoft:aasoft/channel_slash
Open

fix(storage): sanitize preview channel db filenames#16398
2asoft wants to merge 1 commit intoanomalyco:devfrom
2asoft:aasoft/channel_slash

Conversation

@2asoft
Copy link
Contributor

@2asoft 2asoft commented Mar 6, 2026

Issue for this PR

Closes #16396

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This fixes startup failures for preview builds when the channel contains /.
Preview builds use the git branch as the channel. That channel was being used directly in the local SQLite filename, so a channel like foo/bar produced opencode-foo/bar.db. SQLite treated that as a nested path and startup failed with unable to open database file.
This change sanitizes / before building the database filename so preview channels still get isolated databases without creating invalid paths.

How did you verify your code works?

  • Added a regression test in packages/opencode/test/storage/db.test.ts
  • Ran bun test test/storage/db.test.ts
  • Ran bun test test/storage/db.test.ts test/storage/json-migration.test.ts
  • Reproduced the failure with a preview channel containing / and verified the sanitized path is opencode-foo-bar.db

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: preview channel database path fails when the channel contains a slash

1 participant