8000 feat(jobs): rich sync-failure diagnostic report behind banner toggle by johannboehme · Pull Request #40 · johannboehme/tk-1 · GitHub
[go: up one dir, main page]

Skip to content

feat(jobs): rich sync-failure diagnostic report behind banner toggle - #40

Merged
johannboehme merged 1 commit into
mainfrom
claude/distracted-poitras-669899
May 9, 2026
Merged

johannboehme merged 1 commit into
mainfrom
claude/distracted-poitras-669899

Conversation

@johannboehme
Copy link
Copy Markdown
Owner

Summary

  • Replaces the opaque `File could not be read! Code=-1` sync banner with a self-sufficient diagnostic report.
  • Captures stage, original Error.name/message/stack, browser/OS, capability snapshot (WebCodecs, OPFS, WebGPU, SAB, COI, WebGL2), OPFS quota, and the file currently in flight (name, size, type, source-kind).
  • Banner stays a one-line summary inline; `Show details` toggles the full multi-line plaintext report, `Copy details` puts it on the clipboard.

Why

When the same MP4 imports fine on one machine but fails with the native `File could not be read! Code=-1` Chromium DOMException on another, the current banner gives us nothing actionable. A screenshot of the new banner with details expanded carries enough context (browser, capabilities, file metadata, original error name + stack) to triage without follow-up Q&A.

What changed

  • NEW `frontend/src/local/diagnostics.ts` — `collectSyncFailureReport()` + plaintext formatter. Pure async; degrades gracefully if a sub-step fails so the original error is never lost.
  • `frontend/src/local/ops-store.ts` — `SyncOpState` gains `errorReport` and `currentFile`; `failSyncOp(jobId, message, report?)`.
  • `frontend/src/local/jobs.ts` — tracks `currentFile` before + after each `loadAssetFile` / `loadJobAudio` so a load-time failure still names the file in flight; `runSync`'s catch funnels through `collectSyncFailureReport`.
  • `frontend/src/pages/JobPage.tsx` — Banner gains optional `details` prop with `Show details` toggle and `Copy details` clipboard button.
  • NEW `frontend/src/local/diagnostics.test.ts` — covers summary/report shape, stack-less errors, non-Error throws, missing op fallback, capability rendering.

What this does NOT do

  • Doesn't fix the underlying OPFS `FileReader` Chromium quirk — the goal here is just to see exactly what's breaking so we can target the right fix in a follow-up.
  • Doesn't refactor codec-layer throw sites with a typed error class. If the first real-world report shows we need extras (e.g. the detected codec string from `streaming-mp4-audio.ts`), that's a focused follow-up.
  • No telemetry / network — the report is local, copy-paste only.

Test plan

  • `npm run test` — 954 passed (5 new in `diagnostics.test.ts`)
  • `npx tsc --noEmit` — clean
  • Manual: temporarily `throw new Error("synthetic boom")` after the master-audio load in `runSync`; confirm banner shows `[decoding-studio-audio] Error: synthetic boom`, `Show details` reveals the multi-line report, `Copy details` writes to clipboard
  • Real-world: ship to brother's machine, capture a `Show details` screenshot of the actual failure to identify the root cause

🤖 Generated with Claude Code

Replace the opaque "File could not be read! Code=-1" sync banner with a
self-sufficient bug report. The op-store now tracks the file in flight
(name, size, type, source-kind), and runSync's catch funnels every
failure through `collectSyncFailureReport()` which captures stage,
original Error.name + message + stack, browser/OS, capability snapshot
(WebCodecs, OPFS, WebGPU, …) and OPFS quota into a multi-line plaintext
report. The banner shows the one-line summary inline; "Show details"
toggles the full report and "Copy details" ships it to the clipboard,
so a user-side screenshot or paste is enough to triage on its own.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@johannboehme
johannboehme merged commit b97b6b2 into main May 9, 2026
1 check passed
@johannboehme
johannboehme deleted the claude/distracted-poitras-669899 branch May 9, 2026 14:42
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

0