Skip to content

fix(figures): the styled upload could fail without saying so - #39

Merged
catomean merged 1 commit into
mainfrom
fix/styled-upload-silent-failure
Sep 2, 2026
Merged

fix(figures): the styled upload could fail without saying so#39
catomean merged 1 commit into
mainfrom
fix/styled-upload-silent-failure

Conversation

@catomean

@catomean catomean commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

What was broken

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 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:

So the class is closed instead of the instance. src/hooks/mutations-report-failure.test.ts walks every .mutate() / .mutateAsync() call site with the TypeScript parser and fails on any that passes no onError, naming the file and line.

Mutation-verified: reverting the FigureCard change fails the guard at components/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

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
@catomean
catomean merged commit c39334a into main Sep 2, 2026
1 check passed
@catomean
catomean deleted the fix/styled-upload-silent-failure branch September 2, 2026 04:06
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>
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