client state vs server state
Distinguish a local interaction draft from cached data owned by a server.
Use this when Editing a form unintentionally changes other views before saving.
without the term
“When I edit the profile form, the name in the header changes before I click save, and if I cancel it stays changed. Can you keep the unsaved edits separate from the real data?”
with the term · How do you ask a model for client state vs server state?
Separate this form’s draft from its server cache. Test cancel, failed save, and a successful response without mutating the cached record in place.
What is client state vs server state?
Server state is a cached copy of data the server owns; client state is something like an unsaved draft that only the browser has. They refresh, update, and recover differently, so keep them in separate places.
Why does client state vs server state matter when vibe coding?
One shared object can blur unsaved input and confirmed data.
How do you do client state vs server state?
Give the draft a lifecycle and reconcile the server cache after the mutation resolves.
What goes wrong with client state vs server state?
Overwriting an unsaved draft whenever background data refreshes.