fromServiceStitchObject throws on null paletteIndex, swallows success as 'Auto-digitize failed' #27
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#27
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 —
fromServiceStitchObjectthrows onpaletteIndex: null, swallow success as "Auto-digitize failed"Severity: P0 (silent failure of the success path).
Reproduction (after #23 and #26 are fixed):
{stitchObjects: [...600 stitches, paletteIndex: null]}(visible in/tmp/easystitch-svc.log).Root cause —
src/lib/digitize-adapters.ts:123-127(pre-fix):The engine currently returns
paletteIndex: nullbecause the Brother PR10 catalog lookup is a downstream concern (issue #24, not implemented yet). The frontend throws in the success mapping, which the try/catch inuseWorkspace.runAutoDigitizeswallows as a generic error, surfacing the toast.Fix (applied in commit pending): treat null as "unresolved", fall back to
paletteIndex: 0, keycolorIdby the engine-suppliedthreadColorinstead ofpalette-${index}(which producedpalette-null).Verification: after the fix, the live browser run produced no error toast, canvas rendered pixel content, and the service log shows
POST /v1/digitize HTTP/1.1" 200 OK. Unit test added: "tolerates a null paletteIndex from the engine (falls back to 0)" — 198 / 198 unit tests still pass.Related: discovery context is #23 (multipart fix), #26 (maxColors fix), #24 (catalog lookup, the eventual reason
paletteIndex: nullbecomes resolvable).Auto-triage: needs decompose
Marked
triage-approved+needs-decompose. decompose-executor will pick this up and break it into implementable sub-issues.Closed: fixed in
774e0c0(now pushed to origin/main).fromServiceStitchObjectno longer throws onpaletteIndex: null. Falls back topaletteIndex: 0and keyscolorIdby the engine-suppliedthreadColor. End-to-end browser verification:The reason this isn't a no-op: until #24 lands (catalog lookup),
paletteIndex: nullwill keep being the engine's output, so this adapter fix is required for any digitize at all to round-trip cleanly.Mark referenced this issue2026-07-13 23:17:44 +00:00