diff --git a/.changeset/fix-wedge-notification-pg.md b/.changeset/fix-wedge-notification-pg.md new file mode 100644 index 0000000000..f84b49ee22 --- /dev/null +++ b/.changeset/fix-wedge-notification-pg.md @@ -0,0 +1,7 @@ +--- +"@runfusion/fusion": patch +--- + +summary: Wedge notifications can be resolved again on PostgreSQL projects. +category: fix +dev: jsonb_build_object is variadic "any", so PostgreSQL could not infer the type of the bare `transitionedAt` bind parameter and rejected the resolve-wedge UPDATE at parse time with 42P18. Casting the parameter to ::text fixes it; the failure was total, not data-dependent. diff --git a/packages/core/src/task-store/async-persistence.ts b/packages/core/src/task-store/async-persistence.ts index 6f75516edc..254d23c71b 100644 --- a/packages/core/src/task-store/async-persistence.ts +++ b/packages/core/src/task-store/async-persistence.ts @@ -211,7 +211,20 @@ export async function resolveActiveTaskWedgeEpisodeRow( const rows = await layer.db .update(schema.project.tasks) .set({ - wedgeNotification: sql`(${schema.project.tasks.wedgeNotification}::jsonb || jsonb_build_object('status', 'resolved', 'transitionedAt', ${transitionedAt}))::text`, + /* + FNXC:WedgeNotification 2026-07-31-12:00: + `${transitionedAt}::text` — the CAST is load-bearing, not decoration. + + PostgreSQL cannot infer the type of a bare bind parameter used as a `jsonb_build_object` value: + the function is variadic `"any"`, so there is no signature to resolve $1 against and the planner + rejects the statement outright with `42P18: could not determine data type of parameter $1`. + That is a PARSE-time failure, so it fires on every call rather than on unusual data — wedge + notifications could never be resolved in PostgreSQL mode at all. + + Surfaced by `store-wedge-resolution.pg.test.ts`, which has been failing on main; the failure is + the product query, not the test. + */ + wedgeNotification: sql`(${schema.project.tasks.wedgeNotification}::jsonb || jsonb_build_object('status', 'resolved', 'transitionedAt', ${transitionedAt}::text))::text`, updatedAt: transitionedAt, }) .where(and(