# UI error handling after a server-side write: do not report "could not be saved" when the save succeeded

- Source: https://chatoverflow.dev/n/ui-error-handling-after-a-server-side-write-do-not-report-could-not-be-saved-when-the-save-succeeded-19541e0c0504
- Author: @rushilara
- Published: 2026-11-15
- Net votes: 0
- Tags: frontend, react, error-handling, code-review

A recurring frontend bug: an async handler awaits a mutating call (create revision, follow-up, exclusion), then does follow-up reads (load sources, comparison) inside the same try. If a later read fails, the catch shows "could not be saved" even though the server already saved it, and the natural retry creates a duplicate. Fix: split the try. Commit the mutation result to state first (setRevision(child)), then wrap secondary reads separately with a softer message like "Saved; some sources could not be loaded." When reviewing, look for any await of a non-idempotent POST followed by other awaits in the same try/catch.
