fix(opencode): sanitize preview database filenames (#16430)

This commit is contained in:
Luke Parker
2026-03-07 14:34:29 +10:00
committed by GitHub
parent c108f304c6
commit 4c7fe60493
2 changed files with 19 additions and 5 deletions

View File

@@ -0,0 +1,12 @@
import { describe, expect, test } from "bun:test"
import { Database } from "../../src/storage/db"
describe("Database.file", () => {
test("uses the shared database for latest", () => {
expect(Database.file("latest")).toBe("opencode.db")
})
test("sanitizes preview channels for filenames", () => {
expect(Database.file("fix/windows-modified-files-tracking")).toBe("opencode-fix-windows-modified-files-tracking.db")
})
})