Skip to content

fix(next): count repeated server errors and explain the digest - #733

Merged
unjica merged 11 commits into
developfrom
fix/next-digest-dedupe-and-render-error-guide
Oct 5, 2026
Merged

unjica merged 11 commits into
developfrom
fix/next-digest-dedupe-and-render-error-guide

Conversation

@unjica

@unjica unjica commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Base branch: develop

Summary

  • @telemetry-tracker/next 1.3.3 stops createOnRequestError from suppressing a Next.js digest for the life of the process. The same Error object is still reported once, and a second callback in the same turn with that digest is skipped. A later request is reported again, so occurrence counts and spike alerts are not stuck at one.
  • Cross-realm Edge errors keep message and stack when instanceof Error fails. Server onRequestError is documented as Next.js 15+.
  • Global search, the Issues list, and the issues summary match context.digest.
  • Adds /error-tracking/nextjs/server-components-render-error and reverse links from the Next.js guide, /docs/nextjs, /docs/migrate-from-sentry, and the footer. /error-tracking/nextjs/source-maps stays unlinked while it 404s.

The feature commit is 6ae13c40d8921f28f4fddb374e901f865020de38. This branch also merges current develop (keeping the 1.3.3 copy where develop still had the earlier Next.js marketing text) and maps the new guide in the marketing page test.

Do not treat the guide as released until @telemetry-tracker/[email protected] is the version npm returns. Publish only that package, from a tagged origin/main checkout, after this lands on main.

QA

  • Two in-flight HTTP requests with the same digest are both posted. The digest guard clears on the next microtask, before the next request macrotask. Covered by records two in-flight requests with the same digest after the turn ends.
  • Same object and frozen Error: reported once via WeakSet.
  • Next.js 15.5 already skips the SSR instrumentation call when the RSC handler stored that digest. This SDK only collapses a re-entrant second callback in the same synchronous turn. A later call is another occurrence of the same fingerprint, not a second new-error-group alert.
  • Digest search uses the same filter for list totals and pages. SQL paths are case-insensitive; the Prisma JSON path is case-sensitive. A pasted numeric digest or DYNAMIC_SERVER_USAGE matches both. The lookup is an unindexed JSON text match scoped by error_group_id, same class of cost as event property search.
  • Dry-run pack of @telemetry-tracker/[email protected] contains only LICENSE, package.json, and dist/*. dist/server.js is 1.3.3 and uses the turn guard. Exports . and ./server load. No tests, source, or secrets. workspace:* is rewritten to ^1.5.1 only inside the publish tarball.

How to test

  • pnpm lint
  • pnpm test — API 977 passed (78 integration skipped), dashboard 200 passed, core 67, vite-plugin 14, node 27, next 15, publish-guards 17. Local pnpm --filter @telemetry-tracker/node test and next lack a linked vitest bin; those two suites were run with the workspace vitest binary. CI installs the bins.
  • pnpm build — dashboard route /error-tracking/nextjs/server-components-render-error is static.
  • No schema migration.

Code review (Bugbot)

Paused: GitHub bugbot-review is currently a no-op. /review-bugbot is optional.

  • For notification, alert, billing, ingest, or auth changes: considered running /review-bugbot in Cursor (optional while the gate is paused). Ingest payload shape is unchanged; digest search is a read-path filter.
  • If Bugbot comments appear anyway: addressed or replied

Checklist

  • Tests pass (pnpm test; use RUN_DB_INTEGRATION_TESTS=true + Postgres if API integration behavior changed)
  • Lint passes (pnpm lint)
  • Build succeeds (pnpm build)
  • CHANGELOG.md updated under [Unreleased] (if user-facing)
  • Documentation updated (if needed)
  • New code follows the existing style
  • No breaking changes (or called out clearly above)

Security / privacy

Server reporting still strips the query string and does not forward request headers. Digest search reads ErrorOccurrence.context, which is already stored for the project.

Made with Cursor

unjica and others added 11 commits September 30, 2026 13:28
… 1.5.1

Stop fabricating SDK stacks for browser-sanitized Script errors, rate-limit
identical floods, and label them clearly in the dashboard error detail view.

Co-authored-by: Cursor <[email protected]>
…-sanitized-script-error

release: @telemetry-tracker/core 1.5.1 sanitized Script error. + dashboard
* fix(sdk): sanitize Script error. reporting in @telemetry-tracker/core 1.5.1

Stop fabricating SDK stacks for browser-sanitized Script errors, rate-limit
identical floods, and label them clearly in the dashboard error detail view.

Co-authored-by: Cursor <[email protected]>

* fix(sdk): use const for sanitized Script error dedupe store

Co-authored-by: Cursor <[email protected]>

* docs: add Next.js server-side error capture to marketing pages (#729)

- Update /error-tracking/nextjs to include server errors section
  - Add imports for nextEnvLocalServer and nextInstrumentation snippets
  - Add 'Server errors (optional)' section with instrumentation.ts setup
  - Update page description and lede to mention server error capture
  - Update howToJsonLd structured data to mention optional server setup
- Update /sentry-alternative to clarify Next.js supports both client and server errors
  - Modify SDK description to note App Router server errors when configured
- All changes use existing verified snippets from @/lib/sdk-setup-snippets
- Verified against @telemetry-tracker/next 1.3.2 package source
- Tests pass: pnpm test (all tests), pnpm lint, pnpm build

Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: Sanja Malovic <[email protected]>

---------

Co-authored-by: cursor[bot] <206951365+cursor[bot]@users.noreply.github.com>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Sanja Malovic <[email protected]>
Public copy now lists Slack, Discord, and Telegram incoming webhooks without claiming Teams or Power Automate. The migration page maps current SDK calls and records what does not carry over.

Co-authored-by: Cursor <[email protected]>
Give the read-only role Besedolov startup timings without SELECT on Event.properties.

Co-authored-by: Cursor <[email protected]>
Store monotonic clock readings as bigint so values above 9,999,999 stay readable.

Co-authored-by: Cursor <[email protected]>
Gmail iOS recolors text but not CSS gradients, so the wordmark turned light on a light header. Share a solid header fill across notification and release mail.

Co-authored-by: Cursor <[email protected]>
createOnRequestError was dropping later requests that reused a Next.js digest, so occurrence counts and spike alerts undercounted. Report each later request, search context.digest, and add the Server Components troubleshooting guide.

Co-authored-by: Cursor <[email protected]>
Keep the 1.3.3 server reporting and guide where develop still has the earlier Next.js marketing copy.
The guide path was missing from the page map, and the source scan treats cookies() as a dynamic call.

Co-authored-by: Cursor <[email protected]>
* node scripts/measure-sdk-sizes.mjs
*/
import { createRequire } from "node:module";
import { readdirSync, readFileSync, statSync } from "node:fs";
@unjica
unjica merged commit 1c62086 into develop Oct 5, 2026
8 checks passed
@unjica unjica mentioned this pull request Oct 5, 2026
5 of 6 tasks
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