Skip to content

Request ids on every answer and key inputs in desktop problem reports (#381) - #443

Merged
Sebagrei merged 3 commits into
mainfrom
feature/381-request-id-report-inputs
Nov 22, 2026
Merged

Sebagrei merged 3 commits into
mainfrom
feature/381-request-id-report-inputs

Conversation

@Sebagrei

@Sebagrei Sebagrei commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #381 – the request id and the key inputs; screenshot and affected-file attachments stay open (pending a decision, listed in docs/OPEN_WORK.md).

What changed

Server – request ids

  • New middleware in src/lib.rs (assign_request_id, outermost layer): every answer gets an x-request-id header – a new UUID, or a valid incoming id (1–64 characters of [A-Za-z0-9-], e.g. from a reverse proxy). The id is stored in the request extensions (RequestId) and recorded as request_id in the http trace span.
  • src/web/mod.rs passes it to the error page; templates/error.html shows Request id: … in Details for a bug report (and so in Copy details). JSON error bodies are unchanged (header only).
  • Tests: only_short_plain_request_ids_are_taken_over, every_response_carries_the_request_id (lib.rs), the error.html render case in src/templates.rs, and tests/request_id.rs (error page and header carry the same id; proxy id kept, invalid id replaced; API and healthz carry the header).

Desktop – key inputs per action

  • New pure module desktop/ui/js/report-inputs.js (reportInputs, revisionInputs, failureOf): names and short values only, paths reduced to the file name, empty values dropped, at most 12 values of 200 characters (the caps of desktop/src/report.rs, checked by the test).
  • run(statusText, fn, inputs), toast(text, kind, action, inputs) and dialog(…, { inputs }) in core.js pass the inputs (a list or a function evaluated when the error is shown) to Report….
  • Filled at: check-out, release check-out, check-in/park (ticked file names, STEP option), Get files, open file / open in CAD, 3D preview load (a preview that cannot be loaded from the server now also shows an error toast with Report…) and STL export, STEP export, writing SolidCraft item data, revise, obsolete, new item, add files, BOM import / quantities from CAD, folder import, request attachments.
  • scripts/desktop-report-inputs.test.mjs (new CI step in desktop.yml, job ui); scripts/ci-changes.sh runs the ui job when desktop/src/report.rs changes (self-test passes).

Docs: CHANGELOG.md, README.md, desktop/README.md, docs/src/guide/desktop.md, docs/src/admin/operations.md (new Request ids section), docs/src/reference/api.md (x-request-id), docs/src/dev/threat-model.md (new row: forged request ids; report row updated), docs/OPEN_WORK.md.

How it was tested

Not compiled or run locally (no builds on this machine by rule; no Node.js available either) – CI verifies build, clippy, the Rust tests and the Node test. cargo fmt --all was run and scripts/ci-changes.sh --self-test passes.

Checklist

  • This is my own work (or my AI agent's, written from its own
    knowledge), or openly licensed material under a compatible licence
    that is credited. It contains no code decompiled, disassembled or
    rewritten from proprietary software
    and no leaked code
    (CONTRIBUTING.md).
  • Reading a file format: not applicable (no format work).
  • The documentation is updated in this pull request (CHANGELOG.md,
    README.md, docs/src/**, docs/OPEN_WORK.md where it applies).
  • cargo fmt --all --check, cargo clippy --all-targets -- -D warnings
    and cargo test pass locally, or CI runs them. (fmt run locally; clippy and tests: CI)

🤖 Generated with Claude Code

fork and others added 2 commits November 22, 2026 19:15
…#381)

Server: every answer carries an x-request-id header (a new UUID, or a
valid incoming id of 1-64 characters [A-Za-z0-9-]); the request's trace
span records it as request_id, and the web error pages show it under
"Details for a bug report" and in Copy details. Unit tests in lib.rs,
an end-to-end test in tests/request_id.rs.

Desktop: run(), toast() and dialog() take the key inputs of an action
(desktop/ui/js/report-inputs.js: names and short values only, paths
reduced to the file name, at most 12 values of 200 characters), filled
for check-out, check-in/park, get, open, 3D preview and STL export, STEP
export, new item, add files, BOM and folder import, request
attachments. A failed 3D preview now also shows an error toast with
Report... Tested by scripts/desktop-report-inputs.test.mjs (CI job ui).

Docs: CHANGELOG, README, desktop/README, guide/desktop.md,
admin/operations.md, reference/api.md, dev/threat-model.md, OPEN_WORK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 3D preview: toast a failed mesh download only while that viewer is still shown
- CHANGELOG: narrow the claim to previews that cannot be loaded from the server
- OPEN_WORK: list inline error notices without *Report…* as left work
- CLAUDE.md: request ids in the src/lib.rs line of the Architecture map

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sebagrei
Sebagrei marked this pull request as ready for review November 22, 2026 20:50
…d-report-inputs

# Conflicts:
#	CHANGELOG.md
#	desktop/README.md
#	desktop/ui/js/workspace.js
@Sebagrei
Sebagrei merged commit b94af6a into main Nov 22, 2026
8 checks passed
@Sebagrei
Sebagrei deleted the feature/381-request-id-report-inputs branch November 22, 2026 20:53
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