fix(report): persist longform appendix on self-hosted upsert (BUG-576)
Engine calls already returned markdown; the worker failed because local postgres upsert required onConflict and the appendix write omitted it. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
|
||||
import { queryValue } from "../src/lib/db/local-postgres-client-core.ts";
|
||||
import { queryValue, upsertConflictColumns } from "../src/lib/db/local-postgres-client-core.ts";
|
||||
|
||||
test("queryValue keeps calendar dates in local civil form", () => {
|
||||
assert.equal(queryValue("date", new Date(2026, 7, 22)), "2026-08-22");
|
||||
@@ -21,3 +21,10 @@ test("queryValue leaves non-date values unchanged", () => {
|
||||
const leftover = new Date("2026-08-22T12:34:56.000Z");
|
||||
assert.equal(queryValue("unknown", leftover), leftover);
|
||||
});
|
||||
|
||||
test("upsert without onConflict does not throw before execute and defaults to an empty conflict list", () => {
|
||||
assert.deepEqual(upsertConflictColumns(), []);
|
||||
assert.deepEqual(upsertConflictColumns({}), []);
|
||||
assert.deepEqual(upsertConflictColumns({ onConflict: "report_id" }), ["report_id"]);
|
||||
assert.deepEqual(upsertConflictColumns({ onConflict: "user_id, session_id" }), ["user_id", "session_id"]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user