Skip to content

driver-sql's uncompilableAggregateFunctionError docblock states a consequence PR #7402 removes (declared 501 "does not survive to the wire") #7407

Description

@os-help

Observation class — comment-only, no behaviour. Filed from PR #7402 (#5582) rather than fixed there, because that dispatch scoped driver files out.

Fact

packages/drivers/driver-sql/src/sql-driver.ts, uncompilableAggregateFunctionError's docblock, closing paragraph:

Measured consequence, recorded so it is not rediscovered as a bug: on the /data routes mapDataError's generic status passthrough is 4xx-ONLY, so this declared 501 does not survive to the wire — it falls to UNCLASSIFIED_FAULT's 500 INTERNAL_ERROR. That is a gap in the REST boundary — #5582, which this is the first live producer for — not a reason for the driver to misdescribe the fault as the caller's.

Every sentence of that was true when written (#5907) and the pointer to #5582 was exactly right. PR #7402 closes #5582: mapDataError's passthrough is now 400-599, so the declared 501 / NOT_IMPLEMENTED does survive to the wire. Once that merges, the paragraph asserts the opposite of the shipped behaviour.

Why it is worth a line rather than nothing

The paragraph exists precisely to stop the next reader re-diagnosing this as a driver bug. Left as is, it does the reverse: a reader measuring 501 on the wire and reading "does not survive to the wire" has to work out which of the two is stale. The same docblock already carries the repo's own warning about this failure mode one paragraph up — a reachability/consequence argument written into a comment is what rots.

packages/drivers/driver-turso/src/remote-transport.ts and turso-driver.ts carry the same 501 condition; worth a grep for the same wording when fixing (not re-read for this filing).

Suggested disposition

Comment-only edit: replace the measured-consequence paragraph with the post-#5582 reading (the declared 501 now reaches the caller; the driver's job at the throw site is unchanged), keeping the ADR-0112 argument and the issue pointers. Roughly three lines, no test impact. Deliberately not pm:queue — nothing a user hits, and it should ride whenever someone is next in that file, or land as a trivial follow-up once #7402 merges.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions