Skip to content

Improvement: Copy details, Save report and a prefilled Report a problem after a USB error - #2105

Draft
repeat98 wants to merge 3 commits into
mainfrom
fix/support-trail
Draft

repeat98 wants to merge 3 commits into
mainfrom
fix/support-trail

Conversation

@repeat98

@repeat98 repeat98 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

A member who keeps diagnostics sharing off can now hand over what went wrong over USB: Copy details and Save report sit next to every link, sync, self-test and base-update error, and Report a problem fills in what the link knows and offers to attach the recent USB events. Nothing is sent by itself. Members who share diagnostics see no change in what is sent. Site and Worker only: no base, no module, no unit run needed.

  • What was wrong or hard: with sharing off, the link dropped every diagnostic event because nobody was listening (octatrack-link.ts diagnostic() returned early). A member who doesn't share had no record of a failed sync, install or base update and could only describe it in words. After a failed sync, Report a problem asked for what the Octatrack runs by hand. Also, a failed base update that only changed the USB Audio layout said "came back on base 0.8.1, not the new one", because the three throws named the base by version only.
  • What this changes:
    • The link keeps its last 100 diagnostic events in the page's memory (link-trail.ts), whether or not the member shares. They are the same records shared diagnostics carry (numbers, codes, hashes, no names). A reload clears them. The sharing path is unchanged: the same listeners get the same events. The EP0 counter read before a sync still happens only when sharing is on, so a member who doesn't share gets no extra USB request.
    • SupportActions (Copy details, Save report) appears next to the hub's link error, a failed sync in the sync dialog, a failed self-test, a failed base update or USB Audio change, and the install guide's connect error. Copy gives what failed, the message, the base with its layout, IDENTIFY's model text, the browser family and the last 20 events. Save writes a .txt file: readable lines first, then the same data as JSON lines, which parseSupportFile reads back (support-report.ts).
    • Report a problem (configuration report): "It is running" starts as Running modules loaded over USB when the link is connected, and "What happened?" starts with the last error the page showed. Both stay editable. The model stays the member's choice because IDENTIFY reports the stock OS (OCTATRACK 1.40C), not MKI or MKII. Recent events are attached by default; the dialog shows the base with its layout and the event lines, and Remove USB events takes them out. They go only with Post report, through the same /api/configuration-reports request. The Worker checks each event against the shared diagnostics' rules (validateDiagnostic) and refuses anything else (server/support-attachment.ts). The events are stored with the report's configuration and appear in the GitHub issue as a collapsed block next to the log. The form's notice now says that attached USB events are published too.
    • Diagnostics (Your Octatrack and Account) says what the page keeps locally and offers the same two buttons. The privacy page (English and German) gains a paragraph on the local events: kept in memory, never sent automatically, leaving the computer only when the member copies, saves or attaches them, and a public report puts attached events on GitHub. That section's date is now 24 November 2026. The consent text and what sharing sends are unchanged.
    • describeBase moved from UnitPanel.tsx into base-variants.ts and names the base in the three base-update errors, so two layouts of one version read e.g. "0.8.1 (USB Audio off)".
    • Preview: /?preview=usb-link&refusal=7 makes the pretend unit refuse every sync (a module in use), so the failed sync dialog shows its Copy details, Save report and Report a problem.
  • How I checked it: vitest with the fake unit (src/dev/octatrack-link-fake.ts): link-trail.test.ts (7: a refused sync is kept with no listener; EP0 is read only when sharing; bounded and copied; unit and base kept while the unit is away; pre-link failure shaped like the shared record; describeBase on a release with all seven layouts), support-report.test.ts (6: copy text, newest 20 only, save and parse round trip, the Worker accepts a real trail and refuses free text, names, extra fields, other events, more than 50, bad model or layout; the GitHub block sits beside the log within 60,000 characters), SupportActions.test.ts (4, jsdom: copy and save send nothing; a clipboard refusal says "Copy failed"; Report a problem prefills, shows, removes and re-attaches the events and posts them only on submit), and a new case in configuration-report-flow.test.ts (events reach the GitHub issue; a tampered event gets a 400 and stores nothing). The suites around it pass: 19 files, 332 tests (link, base variants, LoadDialog, hub, install guide, overview, unit panel, diagnostics, configuration reports, privacy, issues, App guide). npm run pr:ready (merged main at 470f568): every check passed except one test outside this change, src/components/ModuleCaution.test.ts ("reserves Heavy CPU for POLY8 and Grain…"), which still expects SYNTIZ to read High CPU after SYNTIZ 0.1.1-experimental: cheaper on the ColdFire while it plays #1978 changed its performance evidence on main. That test fails on main too and needs its own Fix:. It also needed support-report.ts listed as shared site and Worker code in LICENSES/platform.json (notices regenerated), because the Worker imports it.
  • Tested on a unit: Not tested on a unit: site and Worker only. The link's USB requests are unchanged, which the EP0 test above checks.
  • Edge cases: none for the unit, because no built package or base changes. On the site: a page with no events (copy says so and nothing is attached), the unit unplugged after a failure (the last base an event named is used), and a Digitakt or Digitone report (no attachment; the Worker refuses one). Each has a test.
  • What the guides lacked or got wrong, and where I fixed it: /modwerk-diagnostics only knew shared records. It now says a member who doesn't share can hand over Copy details, a saved modwerk-support-*.txt or a report's USB events block, read with parseSupportFile (both skill copies). docs/APP_DEVELOPMENT.md is over 40 KB, so its private diagnostics section was left alone; the code comments in link-trail.ts and support-report.ts carry the rule.
Notes for review
  • noteError keeps the last error text the page showed (link notices and the dialogs' own errors) only to prefill the editable "What happened?" field. It never goes into the attachment or the saved JSON lines.
  • A link_failed event in the trail can carry the base while a trial reconnects. The attachment strips it to {event, phase, failure}, the same shape the collector shares, so the Worker's check takes it.
  • Request size for configuration reports grows by SUPPORT_ATTACHMENT_BYTES (48 KiB), and the attachment is capped at 50 events.
  • Private reports keep the events in the report's context, which maintainers of the configuration can read through the API, like the device log. The site's private report page doesn't show them yet.

🤖 Generated with Claude Code

…em after a USB error

A member who leaves diagnostics sharing off had no trail of a failed sync,
install or base update: the link dropped every diagnostic event when nobody
listened (octatrack-link.ts diagnostic()), and Report a problem asked for
what the Octatrack runs by hand.

The link now keeps its last 100 diagnostic events in the page's memory
(link-trail.ts), the same records shared diagnostics carry, whether or not
the member shares. Nothing is sent by itself; shared diagnostics go to the
same listeners as before, and the EP0 counter read stays for sharing only.

- Copy details and Save report beside the link, sync, self-test and base
  update errors (SupportActions): what failed, the base with its layout,
  the model text and the events, readable and as JSON lines
  (support-report.ts, parseSupportFile reads a saved file back).
- Report a problem fills in "It is running" and the last error, and offers
  the recent events as an attachment the member sees and can remove. The
  Worker checks each event against the shared diagnostics' rules and puts
  them in the GitHub issue beside the log.
- A failed base update names the layout when two bases share a version
  (describeBase, moved to base-variants.ts).
- Privacy page and the Diagnostics section say what the page keeps locally.
- ?preview=usb-link&refusal=7 shows a refused sync with the new actions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Nov 24, 2026
repeat98 and others added 2 commits November 24, 2026 11:19
The Worker renders and checks attached USB events with it, so it is shared code
under the same licence as the diagnostics contract; notices regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant