Skip to content

Match SQLite cancel payload to PostgreSQL - #1400

Closed
bgentry wants to merge 1 commit into
masterfrom
bg/sqlite-jobcancel-notify
Closed

bgentry wants to merge 1 commit into
masterfrom
bg/sqlite-jobcancel-notify

Conversation

@bgentry

@bgentry bgentry commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

SQLite cancellation notifications added in #1398 use json_object, which emits compact JSON. PostgreSQL's json_build_object output includes spaces, so the same control event has different payload bytes across drivers. The existing worker test cancels from the client running the job, leaving cancellation from an independent client untested.

Fix this by formatting the SQLite outbox payload to match PostgreSQL's key order, spacing, and JSON string escaping. The notification keeps the transactional insertion path added in #1398.

Add a byte-exact payload check with escaped queue characters, a two-client SQLite test where one client cancels work in the other, and a cross-driver case for an empty control topic.

@bgentry
bgentry force-pushed the bg/sqlite-jobcancel-notify branch 2 times, most recently from b364abf to c8903b6 Compare September 27, 2026 22:55
@bgentry bgentry changed the title fix SQLite cancellation notifications Match SQLite cancel payload to PostgreSQL Sep 27, 2026
SQLite cancellation notifications use `json_object`, which emits
compact JSON while PostgreSQL's `json_build_object` text includes
spaces. The same control event therefore has different payload bytes
across drivers.

Format the SQLite outbox payload with PostgreSQL's key order, spacing,
and string escaping while keeping its transactional insertion path.

Cover exact payload bytes, cancellation through independent SQLite
clients, and direct driver cancellation with no control topic.
@bgentry
bgentry force-pushed the bg/sqlite-jobcancel-notify branch from c8903b6 to f37dcf3 Compare September 27, 2026 22:56
@bgentry bgentry closed this Sep 28, 2026
@bgentry
bgentry deleted the bg/sqlite-jobcancel-notify branch September 28, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant