fix(compose): surface failed figure saves instead of discarding them silently - #36
Merged
Merged
Conversation
…silently Dragging, resizing, or reordering a figure calls updateFigure.mutate with no onError handler, while every other mutation in the app (upload, surface save, figure edit) toasts on failure. A failed PATCH here left Konva's local node position out of sync with the DB with zero indication anything went wrong — the user only discovered the loss on a later reload, by which point the change felt real. Wire the same toast.error(err.message) pattern already used elsewhere in this file family.
catomean
added a commit
that referenced
this pull request
Aug 31, 2026
…lently Every other mutation call site in the app toasts on error; these two in FigureCard were missed, so a failed rename or delete looked like it worked. Same failure shape as the compose-canvas fix in #36. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F5CTjNgbJPinRvWERuUbs6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
handleDragEnd/handleScaleChangeinCompositionCanvas.tsxandmoveLayerinCanvasToolbar.tsxcalledupdateFigure.mutate(...)with noonErrorhandler, unlike every other mutation call site in the app (FigureUploader.tsx,FigureCard.tsx,style/page.tsx,surface/page.tsx), which alltoast.error(err.message)on failure.figureprop, a failed PATCH (network blip, auth expiry, ownership-check race) left the figure visibly in its new position with zero feedback that the save never landed — the user only found out on a later reload, by which point the "why" was gone. Same for a resize or a layer-order change.toast.error(err.message)convention already used elsewhere in this file family onto the three unguardedmutatecalls. No behavior change on the success path.Test plan
npm run verify(lint + typecheck + test): 0 lint errors (8 pre-existing warnings, unrelated), tsc clean, 84/84 tests pass.env.local/ Supabase credentials configured in this environment, and forcing a mutation failure (network blip, auth expiry) isn't reachable through the UI without one. The change itself only adds anonErrorcallback matching an already-tested, already-shipped pattern used identically elsewhere in the same component family.🤖 Generated with Claude Code