Skip to content

Improve crash reporting diagnostics / 增强崩溃上报诊断#4285

Merged
esengine merged 2 commits into
main-v2from
feature/structured-crash-reporting
Jun 13, 2026
Merged

Improve crash reporting diagnostics / 增强崩溃上报诊断#4285
esengine merged 2 commits into
main-v2from
feature/structured-crash-reporting

Conversation

@SivanCola

Copy link
Copy Markdown
Collaborator

Summary

  • Send structured frontend exception reports with source, label, error type, stack, top frame, view, build metadata, and bounded breadcrumbs.
  • Capture Go-side panics into a pending crash report and flush them on the next launch when desktop telemetry is enabled.
  • Add client-side and Worker-side redaction for home-directory paths, emails, bearer/API keys, JWTs, and long token-like strings before reports are sent or stored.
  • Expand the crash-report Worker dashboard with source/severity/version/platform metadata, filters, regression reopening, retained first sample plus latest samples, and structured sample details.
  • Generate hidden frontend source maps and move them out of dist into an ignored desktop/frontend/sourcemaps/<commit>/ directory for private symbolication.

Required production deployment order

This PR changes the live D1 schema. A maintainer with access to the Cloudflare account that owns the reasonix-crash D1 database and reasonix-crash-report Worker should run the migration before deploying the matching Worker.

  1. Back up or snapshot the production D1 database reasonix-crash.
  2. Apply the one-time migration:
cd workers/crash-report
npx wrangler d1 execute reasonix-crash --remote --file=migrate-structured-reports.sql
  1. Deploy the Worker after the migration succeeds:
cd workers/crash-report
npm run typecheck
npm run deploy
  1. Release the desktop app after the Worker is deployed.

Important: do not run schema.sql against the existing production database as the upgrade path. schema.sql is for fresh databases; existing production needs migrate-structured-reports.sql. Running the new Worker before the migration can make crash report inserts fail because the new columns do not exist yet.

Verification

  • go test ./... from desktop
  • pnpm typecheck from desktop/frontend
  • pnpm test from desktop/frontend
  • pnpm build from desktop/frontend
  • npm run typecheck from workers/crash-report
  • git diff --check
  • Confirmed desktop/frontend/dist contains no .map files after build

@SivanCola SivanCola requested a review from esengine as a code owner June 13, 2026 10:38
@github-actions github-actions Bot added desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 905d93dc71

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread workers/crash-report/src/index.ts Outdated
Comment thread workers/crash-report/src/index.ts
Comment thread workers/crash-report/src/index.ts Outdated
Comment thread workers/crash-report/src/index.ts
@esengine esengine merged commit ea0c3a9 into main-v2 Jun 13, 2026
13 checks passed
@esengine esengine deleted the feature/structured-crash-reporting branch June 13, 2026 15:25
esengine pushed a commit that referenced this pull request Jun 14, 2026
Add a user-initiated performance-pressure report prompt when the desktop observes long tasks, event-loop lag, or high JS heap pressure. Captures coarse diagnostic context (timing, heap, visibility, network, breadcrumbs, version, OS), scrubs it through the existing crash-report pipeline as kind: performance, and lets the Worker/dashboard ingest it with no DB migration.

Follow-up to #4285. Worker must be deployed before the desktop release that sends performance reports (old kind enum rejects them).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants