fix(web): keep synthetic fingerprints out of the errors sparkline query - #573
Merged
Merged
Conversation
`error_issues.fingerprint_hash` is shared by three issue kinds: "error" rows
hold the decimal UInt64 from ClickHouse, while "alert" and "integration" rows
reuse the column for a synthetic key (`alert:{ruleId}:{groupKey}`,
`planetscale:{database}:{event}`).
The errors hub sent every visible issue's fingerprint to `errorsSpark`, which
lowers the list into `FingerprintHash IN (toUInt64('…'), …)`. One alert-backed
issue on screen made ClickHouse reject the whole batch, so the sparklines 500'd
for every row in the list.
Filter to error-kind issues before the round-trip — the same guard
`ErrorIssueReadModelsService.getIssue` already applies on the detail path, which
is why issue detail never hit this. Rows without a series already degrade to an
empty spark, and an all-alert list skips the request entirely.
JeremyFunk
had a problem deploying
to
pr-preview
August 23, 2026 21:18 — with
GitHub Actions
Failure
🍁 Maple PR previewWarning Preview cleanup could not be confirmed. The Alchemy teardown outcome was Final commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
Loading
/errorsreturned a 500 fromerrorsSpark:error_issues.fingerprint_hashis shared across three issue kinds:erroralertalert:{ruleId}:{groupKey}integrationplanetscale:{database}:{event}The errors hub sent every visible issue's fingerprint to the batched sparkline
query, which lowers the list into
FingerprintHash IN (toUInt64('…'), …). Asingle alert-backed issue on screen made ClickHouse reject the whole batch — so
the sparklines failed for every row in the list, not just that one.
Issue detail never hit this because
ErrorIssueReadModelsService.getIssuealready skips the warehouse for non-error kinds.
Fix
Apply the same guard before the round-trip, as
sparkFingerprintHashes()inlib/models/error-signal.ts. Alert and integration rows already degradecorrectly:
buildErrorSignalsfalls back to an empty series, andgetErrorsSparkshort-circuits an empty list, so a view holding only alertissues skips the request altogether.
Not covered here
/internal/query-engine/errors-sparkstill lowers a caller-supplied liststraight into
toUInt64(), so a future caller passing a synthetic key gets a500 rather than a 400. Tightening the shared
FingerprintHashprimitive todecimal-only would be wrong —
parseFingerprintHashesin the v2 issues routelegitimately filters Postgres by
alert:values — so that hardening would needto live at the warehouse-bound boundary specifically. Left out of this fix.
Verification
bun run --cwd apps/web test src/lib/models/error-signal.test.ts— 12 passed,including a new case built from the fingerprint in the failing trace
bun run --cwd apps/web typecheck— cleanNot verified in a browser: reproducing needs an alert-backed issue in the hub
list, which local data does not have. The failing path is a data-selection
choice, covered by the unit test instead.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.