fix(figures): the styled upload could fail without saying so - #39
Merged
Conversation
FigureCard's styled-image upload patched the figure row with no onError. The file reached storage, the row write could fail, and nothing was shown: the card kept offering "Upload styled" over an upload that looked like it worked, and the styled image — the artifact the whole manual pipeline exists to produce — was silently not attached. This is the third save shipped with no failure path (#36 compose placement, e399f4a label/delete, this one), so the class is closed rather than the instance: a guard walks every .mutate()/.mutateAsync() call site with the TypeScript parser and fails on any that passes no onError. Mutation-verified — reverting the FigureCard fix fails the guard at components/figures/FigureCard.tsx:47. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BjpTz8zzJhUTK9UWw9SPgS
This was referenced Sep 4, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Sep 5, 2026
) Upsert deleted the existing surface before inserting the new one but never checked the delete's result. If the delete silently failed (RLS misconfig, transient DB error), the insert left two rows for one project, and every later GET for that surface would 500 since it relies on .maybeSingle() expecting at most one row. Same unchecked-error family as PR #36/#37/#39/#40/#43. Co-authored-by: Mao Nakamoto <maonakamoto@users.noreply.github.com>
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.
What was broken
FigureCard's styled-image upload patched the figure row with noonError. The file reached storage, the row write could fail, and nothing was shown — the card kept offering "Upload styled" over an upload that looked like it worked, and the styled image (the artifact the manual Grok pipeline exists to produce) was silently not attached.Why a guard, not just a fix
This is the third save shipped with no failure path:
e399f4a— figure label / delete (same file, missed this call site)So the class is closed instead of the instance.
src/hooks/mutations-report-failure.test.tswalks every.mutate()/.mutateAsync()call site with the TypeScript parser and fails on any that passes noonError, naming the file and line.Mutation-verified: reverting the
FigureCardchange fails the guard atcomponents/figures/FigureCard.tsx:47 updateFigure.mutate.Verification
npm run verify: lint 0 errors (8 pre-existing warnings) · tsc clean · 87 tests pass (was 84)🤖 Generated with Claude Code
https://claude.ai/code/session_01BjpTz8zzJhUTK9UWw9SPgS