Export PES dialog silently submits stitch_objects:[] and swallows API 422 — export is a no-op from the UI #103
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-attention
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/Kimi_Agent_Brother_10_Digitizing_App#103
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug 2: Export PES dialog silently fails — submits empty
stitch_objects[], swallows API 422Severity
High (core export path is a no-op in the most common UI path).
Reproduction
/workspace.tests/fixtures/flower.png.(digitize completes).
(PES/DST/SVG/PDF), Hoop Size, and a line: "This design uses 0 Brother PR-10 thread stops".
Expected: a
.pes(or chosen format) file is downloaded viatriggerDownload.Actual: no
downloadevent fires. The browser stays idle.Evidence
Captured dialog body verbatim from a live probe after a successful digitize:
Two symptoms:
0 thread stopsdespite the workspace having just emittedstitch objects via
commitDigitizedResult./api/easystitch/v1/exportwithstitch_objects: [], which the backend correctly rejects with422 {"detail":[{"type":"too_short","loc":["body","stitch_objects"],"msg":"List should have at least 1 item, not 0"}]}.The frontend swallows the 422. No toast, no inline message, no dialog close,
no retry. The dialog stays open with the user staring at "Export" again.
Backend smoke test (rules out backend)
A direct curl with a hand-crafted payload of 1 stitch_object (8 points) returns:
Valid PES file. The backend export pipeline works correctly when given real
stitch_objects[]. The bug is entirely on the frontend:src/components/workspace/ExportDialog.tsxline ~67.Root cause (best guess from layout)
ExportDialogreads stitch objects viauseWorkspace()and passes them toexportPES(...). Either:though
state.stitchObjectsis populated, OREither way, no client-side guard exists ("if stitch_objects.length === 0, show
inline error"), and the catch block around
exportPESdoes not surfaceEasystitchErroras a toast.Suggested fix
In
ExportDialog.tsx:Plus investigate why the dialog sees 0 thread stops when the Redux state has them.
Related
tested end-to-end after that fix.
This bug is the export side of that same pipeline — proving the design
exists in state isn't proving the dialog can read it back.
Closed by
ed6b7a4on main.Fix:
canExportprop; Export PES button is now disabled when no stitch objects exist (with tooltip explaining why).canExport = appState === 'digitized' && stitchObjects.length > 0so the button is only clickable after a successful digitize.data-testid="export-inline-error") renders inside the dialog so the empty-state is self-explanatory instead of a transient toast.Tests: 12 ExportDialog + 10 AppHeader pass (3 new tests each); tsc -b + eslint clean.