Repository navigation
fix(sentry): retry proof writes and stop reporting handled failures - #715
Conversation
The 2026-11-24 Sentry check-in found site-side causes behind several open issues. The signup proof batch failed whenever D1 dropped the connection, because D1 does not retry a write (SKILLD-42, SKILLD-5H). Intended dependency-outage 503s matched a message suffix that the package route and search never used, so they reported as unhandled (SKILLD-44, SKILLD-4Z). A structural cause tag replaces the suffix. Nitro reported failed KV cache reads it had already served as misses (SKILLD-28), and the browser reported cancelled requests and layout notices the shared nuxt-sentry policy already treats as noise. The homepage called toSorted, which an older browser lacked during hydration (SKILLD-4P); a lint rule now keeps ES2023 array copies out of app code. A thrown.cause tag records what the messageless SKILLD-54 error was thrown with.
🤖 MERGED
GitHub merged this pull request.
beec6364-ebd8-4f55-a7f8-1e15f2c7dbf6 Selected findings run after merge and open separate pull requests. |
There was a problem hiding this comment.
Harlan Agent Kit posted this automated review. AI open source policy.
Automated Review: PENDING.
Optional follow-ups
Minor (72/100) · Thrown-cause tags accept arbitrary text and can interrupt error reporting
For an empty-message Error with an object cause, Object.prototype.toString reads the cause's Symbol.toStringTag. That property can supply arbitrary text, which filterClientReport puts in thrown.cause and scrubSentryEvent leaves intact. A throwing getter also makes beforeSend fail before it can return the original report. Custom event types and Error names likewise reach the tag as free-form text.
Optional follow-up: Map causes to fixed category labels and avoid reading custom metadata from arbitrary objects.
Minor (67/100) · The browser filter hides missing manifests for the current build
The path pattern matches every build ID under /builds/meta/, including the ID running in the reporting browser. If a deployment is missing its current manifest, that browser's 404 is dropped the same way as an expired tab's 404. The keep-case in the new test uses /builds/latest.json, which is a different endpoint and never matches the pattern.
Optional follow-up: Compare the requested manifest ID with the running build ID and retain the report when the filter cannot establish that the requested build is retired.
Minor (61/100) · Package inspection failures are reported as upstream outages
The detector returns Unavailable for both upstream request failures and local inspection failures, including an archive that exceeds the site's byte cap or fails tar validation. The existing oversized-package fixture exercises that branch. The route now marks both cases as a dependency outage, causing server beforeSend to suppress the 503. Its replacement wide event contains only the operation and outcome, so repeated inspection failures are indistinguishable from upstream outages.
Optional follow-up: Carry a failure category through package detection and the cache, and apply the outage mark only to transient dependency failures.
Minor (57/100) · Search suppresses reports for permanent database query failures
lexicalSkillSearch converts every rejected query to null and emits a wide event with only the operation and outcome. In lexical-only mode, a permanent D1 query error such as a missing skills_fts table therefore takes the same path as a disconnected database. The new outage tag suppresses the resulting 503 in Sentry, leaving the wide event unable to distinguish a broken schema from downtime.
Optional follow-up: Preserve the lexical failure category and reserve the outage mark for failures classified as transient.
Trivial (38/100) · Vue templates bypass the ES2023 array-method guard
ESLint's core no-restricted-properties rule visits the script AST. Vue template expressions are visited through Vue's separate template visitor, so a toSorted call in a v-for or binding passes this rule and still runs in browsers without that method.
Optional follow-up: Add a Vue template restriction for the same three array methods.
| return cause.name | ||
| if (typeof cause !== 'object' || cause === null) | ||
| return typeof cause | ||
| return Object.prototype.toString.call(cause).slice(8, -1) |
There was a problem hiding this comment.
Minor (72/100): Thrown-cause tags accept arbitrary text and can interrupt error reporting
For an empty-message Error with an object cause, Object.prototype.toString reads the cause's Symbol.toStringTag. That property can supply arbitrary text, which filterClientReport puts in thrown.cause and scrubSentryEvent leaves intact. A throwing getter also makes beforeSend fail before it can return the original report. Custom event types and Error names likewise reach the tag as free-form text.
Map causes to fixed category labels and avoid reading custom metadata from arbitrary objects.
- Ask an agent to verify and fix this finding
Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy.
| return message === 'Failed to execute \'postMessage\' on \'BroadcastChannel\': Channel is closed' | ||
| } | ||
|
|
||
| const CLIENT_NOISE_MESSAGE = /ResizeObserver loop|AsyncData request cancelled by |signal is aborted without reason|\/builds\/meta\/[\w-]+\.json": 404 / |
There was a problem hiding this comment.
Minor (67/100): The browser filter hides missing manifests for the current build
The path pattern matches every build ID under /builds/meta/, including the ID running in the reporting browser. If a deployment is missing its current manifest, that browser's 404 is dropped the same way as an expired tab's 404. The keep-case in the new test uses /builds/latest.json, which is a different endpoint and never matches the pattern.
Compare the requested manifest ID with the running build ID and retain the report when the filter cannot establish that the requested build is retired.
- Ask an agent to verify and fix this finding
Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy.
| if (result._tag === 'Unavailable') | ||
| throw createError({ statusCode: 503, message: 'Package details are unavailable. Try again later.' }) | ||
| throw dependencyOutageError({ dependency: 'GitHub or npm', message: 'Package details are unavailable. Try again later.' }) | ||
| return result |
There was a problem hiding this comment.
Minor (61/100): Package inspection failures are reported as upstream outages
The detector returns Unavailable for both upstream request failures and local inspection failures, including an archive that exceeds the site's byte cap or fails tar validation. The existing oversized-package fixture exercises that branch. The route now marks both cases as a dependency outage, causing server beforeSend to suppress the 503. Its replacement wide event contains only the operation and outcome, so repeated inspection failures are indistinguishable from upstream outages.
Carry a failure category through package detection and the cache, and apply the outage mark only to transient dependency failures.
- Ask an agent to verify and fix this finding
Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy.
| // Each lane already recorded its own failure as a wide event. | ||
| if (lexicalKeys === null && semanticHits === null && expansionHits === null) | ||
| throw createError({ statusCode: 503, statusMessage: 'Search is temporarily unavailable.' }) | ||
| throw dependencyOutageError({ dependency: 'D1 and Vectorize', statusMessage: 'Search is temporarily unavailable.' }) |
There was a problem hiding this comment.
Minor (57/100): Search suppresses reports for permanent database query failures
lexicalSkillSearch converts every rejected query to null and emits a wide event with only the operation and outcome. In lexical-only mode, a permanent D1 query error such as a missing skills_fts table therefore takes the same path as a disconnected database. The new outage tag suppresses the resulting 503 in Sentry, leaving the wide event unable to distinguish a broken schema from downtime.
Preserve the lexical failure category and reserve the outage mark for failures classified as transient.
- Ask an agent to verify and fix this finding
Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy.
| files: ['app/**', 'layers/*/app/**'], | ||
| name: 'skilld/client-array-copies', | ||
| rules: { | ||
| 'no-restricted-properties': [ |
There was a problem hiding this comment.
Trivial (38/100): Vue templates bypass the ES2023 array-method guard
ESLint's core no-restricted-properties rule visits the script AST. Vue template expressions are visited through Vue's separate template visitor, so a toSorted call in a v-for or binding passes this rule and still runs in browsers without that method.
Add a Vue template restriction for the same three array methods.
- Ask an agent to verify and fix this finding
Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy.
🔗 Linked issue
None. The D1 internal errors stay with #393.
❓ Type of change
📚 Description
The 2026-11-24 Sentry check-in found 60 open skilld issues. Most are D1 overload and internal errors, which this PR does not change. It fixes the causes the site owns:
/api/events/signup-proof(SKILLD-42, over 400 events). The batch now runs throughretryIdempotentD1Write, andINSERT OR IGNOREmakes a replay after a committed batch a no-op.dependencyOutageErrortags the cause, and the serverbeforeSenddrops by that tag instead of the "unavailable upstream" message suffix. The package route (SKILLD-44) and search (SKILLD-4Z) used other messages, so the suffix missed them. The package route now records a wide event, so its outage stays visible. Other 503s, such as missing check-in bindings, still report.cache-readwide event, as it already did for writes. Nitro served those requests, then reported the read as unhandled too (SKILLD-28).filterClientReportreplaces the inline browserbeforeSend. It drops cancelled requests,ResizeObserver loopnotices, and 404s for a retired build's meta file, usingisTransientErrorfrom@harlan-zw/nuxt-sentry. It also tags what a messageless error was thrown with, so the next SKILLD-54 event can show why some Skill pages fail their first navigation.toSortedin app code. The homepage trending board calledtoSorted, which broke hydration on an older browser (SKILLD-4P). A lint rule now banstoSorted,toReversed, andtoSplicedunderapp/andlayers/*/app/.