sync
This commit is contained in:
parent
4d50a32979
commit
bf0754caeb
2 changed files with 2 additions and 31 deletions
|
|
@ -1952,8 +1952,8 @@ function ApplyPatch(props: ToolProps<typeof ApplyPatchTool>) {
|
||||||
</For>
|
</For>
|
||||||
</Match>
|
</Match>
|
||||||
<Match when={true}>
|
<Match when={true}>
|
||||||
<InlineTool icon="%" pending="Preparing apply_patch..." complete={false} part={props.part}>
|
<InlineTool icon="%" pending="Preparing patch..." complete={false} part={props.part}>
|
||||||
apply_patch
|
Patch
|
||||||
</InlineTool>
|
</InlineTool>
|
||||||
</Match>
|
</Match>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|
|
||||||
|
|
@ -232,31 +232,6 @@ describe("JSON to SQLite migration", () => {
|
||||||
expect(stats?.sessions).toBe(0)
|
expect(stats?.sessions).toBe(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
test("creates sqlite-migrated marker file", async () => {
|
|
||||||
await migrateFromJson(sqlite, storageDir)
|
|
||||||
|
|
||||||
const marker = path.join(storageDir, "sqlite-migrated")
|
|
||||||
expect(await Bun.file(marker).exists()).toBe(true)
|
|
||||||
})
|
|
||||||
|
|
||||||
test("skips if already migrated", async () => {
|
|
||||||
await Bun.write(path.join(storageDir, "sqlite-migrated"), Date.now().toString())
|
|
||||||
await Bun.write(
|
|
||||||
path.join(storageDir, "project", "proj_test123abc.json"),
|
|
||||||
JSON.stringify({
|
|
||||||
id: "proj_test123abc",
|
|
||||||
worktree: "/",
|
|
||||||
time: { created: Date.now(), updated: Date.now() },
|
|
||||||
sandboxes: [],
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
|
|
||||||
const stats = await migrateFromJson(sqlite, storageDir)
|
|
||||||
|
|
||||||
// Should return undefined (skipped) since already migrated
|
|
||||||
expect(stats).toBeUndefined()
|
|
||||||
})
|
|
||||||
|
|
||||||
test("is idempotent (running twice doesn't duplicate)", async () => {
|
test("is idempotent (running twice doesn't duplicate)", async () => {
|
||||||
await Bun.write(
|
await Bun.write(
|
||||||
path.join(storageDir, "project", "proj_test123abc.json"),
|
path.join(storageDir, "project", "proj_test123abc.json"),
|
||||||
|
|
@ -269,10 +244,6 @@ describe("JSON to SQLite migration", () => {
|
||||||
)
|
)
|
||||||
|
|
||||||
await migrateFromJson(sqlite, storageDir)
|
await migrateFromJson(sqlite, storageDir)
|
||||||
|
|
||||||
// Remove marker to run again
|
|
||||||
await fs.rm(path.join(storageDir, "sqlite-migrated"))
|
|
||||||
|
|
||||||
await migrateFromJson(sqlite, storageDir)
|
await migrateFromJson(sqlite, storageDir)
|
||||||
|
|
||||||
const db = drizzle({ client: sqlite })
|
const db = drizzle({ client: sqlite })
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue