Skip to content

driver-sql: the hash-shadow NULL-safe arm still hand-rolls duplicate-group formatting, the drift formatDuplicateGroups exists to prevent #16289

Description

@claude

Observation from PR #16288 (#15479), which added the third caller of formatDuplicateGroups and left this one behind. Not fixed there on purpose: it changes the text of an already-shipped durability message, which is a different verification surface from that card's.

What

packages/drivers/driver-sql/src/sql-driver.ts. formatDuplicateGroups is module-local and was added by #14902 for one stated reason — quoting its own docblock:

The two sites that report a blocked unique — the drift entry and the boot-time durability log — must name the SAME rows in the SAME shape, and a second hand-rolled .slice(0, 5).join('; ') is exactly how the plain and the NULL-safe path drifted apart in the first place.

There are now four sites that render duplicate groups. Three go through the helper (the drift entry, the direct arm's plain-unique log, and the hash-shadow arm's plain-unique log added by #16288). The fourth — the hash-shadow arm's NULL-safe branch — still hand-rolls it, and it is the exact .slice(0, 5) + .join('; ') the docblock names.

The drift is already real, in the overflow tail

  • helper: ; ...and N more group(s)
  • hand-rolled: ; ...and N more

So two durability logs about the same class of failure, emitted from the same catch, already disagree about how they say "there are more". Only visible past five conflicting groups, which is why nothing has tripped over it.

Why it was left alone rather than folded in

Adopting the helper changes the text of a message that has shipped, and sql-driver-12998-shadow-null-safe-key.test.ts asserts on that message. It is a one-line change with a live-MySQL verification surface of its own, and #16288's bounded-fix budget did not cover re-measuring an existing message it had no reason to touch.

Suggested shape

Replace the inline construction with formatDuplicateGroups(duplicates), keeping the surrounding Conflicting group(s): ... framing identical to the other three sites, and re-run the live MySQL cell. Whoever takes it should check whether the existing pin asserts the overflow tail (it currently does not appear to — it asserts the Conflicting group(s): prefix), because that decides whether this is text-visible to any test.

⛔ Filed unassigned, as an observation for triage. Grade is deliberately not asserted here; the visible symptom needs more than five conflicting groups in one table.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions