Skip to content

fix(sentry): retry proof writes and stop reporting handled failures - #715

Merged
harlan-zw merged 1 commit into
mainfrom
fix/sentry-checkin-20261124-skilld
Nov 23, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/sentry-checkin-20261124-skilld

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

None. The D1 internal errors stay with #393.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking 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:

  • Signup proof writes retry. D1 does not retry a write on its own, and every page with a sign-up link writes a proof. One lost connection failed /api/events/signup-proof (SKILLD-42, over 400 events). The batch now runs through retryIdempotentD1Write, and INSERT OR IGNORE makes a replay after a committed batch a no-op.
  • Outage 503s carry a mark. dependencyOutageError tags the cause, and the server beforeSend drops 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.
  • KV cache reads fail soft. The route-cache mount turns a failed read into a miss and a cache-read wide event, as it already did for writes. Nitro served those requests, then reported the read as unhandled too (SKILLD-28).
  • Browser reports drop noise. filterClientReport replaces the inline browser beforeSend. It drops cancelled requests, ResizeObserver loop notices, and 404s for a retired build's meta file, using isTransientError from @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.
  • No toSorted in app code. The homepage trending board called toSorted, which broke hydration on an older browser (SKILLD-4P). A lint rule now bans toSorted, toReversed, and toSpliced under app/ and layers/*/app/.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

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.
@harlan-github-agent

harlan-github-agent Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

🤖 MERGED

Harlan Agent Kit posted this automated review. It is not Harlan's personal review or approval. AI open source policy. Last updated: 2026-11-23 22:15 UTC.

GitHub merged this pull request.

  • Logged (72/100): Thrown-cause tags accept arbitrary text and can interrupt error reporting View code Optional follow-up: Map causes to fixed category labels and avoid reading custom metadata from arbitrary objects.
    • Ask an agent to verify and fix this finding
  • Logged (67/100): The browser filter hides missing manifests for the current build View code 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.
    • Ask an agent to verify and fix this finding
  • Logged (61/100): Package inspection failures are reported as upstream outages View code Optional follow-up: 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
  • Logged (57/100): Search suppresses reports for permanent database query failures View code Optional follow-up: Preserve the lexical failure category and reserve the outage mark for failures classified as transient.
    • Ask an agent to verify and fix this finding
  • Logged (38/100): Vue templates bypass the ES2023 array-method guard View code Optional follow-up: Add a Vue template restriction for the same three array methods.
    • Ask an agent to verify and fix this finding

beec6364-ebd8-4f55-a7f8-1e15f2c7dbf6

Selected findings run after merge and open separate pull requests.

@harlan-github-agent harlan-github-agent Bot added the harlan-agent-ready The automated Review passed every gate on this head commit. label Nov 23, 2026

@harlan-github-agent harlan-github-agent Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harlan Agent Kit posted this automated review. AI open source policy.

Automated Review: PENDING.

Read the Review results

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.

View code

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.

View code

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.

View code

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.

View code

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.

View code

Comment thread shared/sentry.ts
return cause.name
if (typeof cause !== 'object' || cause === null)
return typeof cause
return Object.prototype.toString.call(cause).slice(8, -1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread shared/sentry.ts
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 /

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.' })

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread eslint.config.mjs
files: ['app/**', 'layers/*/app/**'],
name: 'skilld/client-array-copies',
rules: {
'no-restricted-properties': [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@harlan-github-agent harlan-github-agent Bot removed the harlan-agent-ready The automated Review passed every gate on this head commit. label Nov 23, 2026
@harlan-zw
harlan-zw merged commit 34c78a7 into main Nov 23, 2026
8 checks passed
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