Skip to content

Normalize frontend error reports and wire the desktop reporter - #1785

Merged
RhysSullivan merged 2 commits into
mainfrom
fix/frontend-error-reporting
Aug 28, 2026
Merged

Normalize frontend error reports and wire the desktop reporter#1785
RhysSullivan merged 2 commits into
mainfrom
fix/frontend-error-reporting

Conversation

@RhysSullivan

@RhysSullivan RhysSullivan commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

A handled failure in the console — a request that 500s, a response that won't decode — was filed as a crash report with no message. The report was titled after the function that did the reporting, so every unrelated frontend failure merged into that one nameless bucket. On the wire the report read Object captured as exception with keys: reasons, ~effect/Cause.

Cause: every producer hands the reporter an Effect Cause, a plain object with no name, message or stack — nothing a crash reporter can title or group on.

The desktop renderer had the same failure plus one of its own: it passed no reporter at all, so handled UI errors fell through globalThis.reportError and were filed as unhandled crashes with the surface/action context dropped.

Fix

  • toReportableError (packages/react api/error-reporting) turns whatever a call site has into a real Error: a Cause's failures and defects keep their message and stack, tagged errors are named by their _tag, and the original hangs off error.cause. Applied at every dispatch path, and idempotent, so layering it is safe.
  • The executor.ui tag block moved into a shared frontend error-reporter factory, so cloud and the desktop renderer differ only in transport.
  • packages/app wires onHandledError to a renderer reporter, so handled UI errors are filed as handled and keep their context once the desktop bridge supplies a DSN. Builds without one keep the global-error-event fallback.

Testing

  • New browser scenario, e2e/cloud/frontend-error-reporting.test.ts: reload the integrations console with its API returning 500, intercept the report the page POSTs to its own origin, and assert the reported failure names the request and the status. Pre-fix it reports Object captured as exception with keys: reasons, ~effect/Cause; with the fix, StatusCode error (500 GET .../api/integrations). It also asserts no report is marked synthetic, which is the grouping half of the bug and the half a readable message can hide: reporting the message as a bare string reads correctly but still groups on the reporting frame.
  • The cloud e2e boot now supplies the browser reporter's DSN, so what the frontend reports is observable at all — production always has one, and without it the reporter is a no-op. Reports are tunnelled same-origin, so nothing leaves the machine.
  • Desktop wiring stays unit-level (packages/app/src/crash-reporting.test.ts): no desktop target boots for this change. The remaining unit tests in packages/react/src/api/error-reporting.test.ts cover only the input shapes a browser run cannot produce on demand — a thrown string, a tagged error declared without a message field, idempotency.

Error-report fingerprinting is deliberately left to a separate PR.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 77131a1 Commit Preview URL

Branch Preview URL
Aug 27 2026, 10:29 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 77131a1 Aug 27 2026, 10:31 PM

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1785

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1785

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1785

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1785

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1785

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1785

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1785

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1785

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1785

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1785

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1785

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1785

executor

npm i https://pkg.pr.new/executor@1785

commit: 77131a1

@RhysSullivan
RhysSullivan force-pushed the fix/frontend-error-reporting branch from e06141e to 0edd4dd Compare August 27, 2026 20:41
@RhysSullivan
RhysSullivan marked this pull request as ready for review August 28, 2026 02:23
@RhysSullivan
RhysSullivan merged commit 3b3c80a into main Aug 28, 2026
44 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