Remix.run Logo
hamandcheese 7 hours ago

I worry that optimistic updates is going to become trendy and applied to more software, but without any plan for the "sad path" - failed to sync, sync conflict, etc. Get ready for a whole new era of race conditions and frustration!

12_throw_away 6 hours ago | parent | next [-]

> optimistic updates [...] without any plan for the "sad path"

based on my experience, this is a great description of the sync implementation in many already widely deployed products (say, off the top of my head, OneNote, OneDrive)

jack_pp 7 hours ago | parent | prev | next [-]

Don't you have the same problems with basic CRUD apps? Also you need to handle the sad path for every single request instead of having the sync engine do it all in one place.

Escapado 7 hours ago | parent | next [-]

Correct but the feedback is usually more immediate. Save a change to your issue and it fails - You will get an error toast and probably stay on the form.

In the local first world you might have navigated away already and created 3 more issues of which 2 more failed because of schema drift or other conflicts. And you might have edited one that was deleted. And now you need to figure out what exactly to tell the user - or what not to tell them.

jack_pp 7 hours ago | parent | next [-]

Well the sync engine can figure out if there's an issue fast, say <500ms, if you build it that way. Then you can just make a toast telling the user there are issues and anything they do will be saved locally only for the time being.

Warn the user that if they leave the website their changes won't be saved remotely.

artman 7 hours ago | parent | prev [-]

In reality conflicts almost never happen.

hamandcheese 7 hours ago | parent | prev | next [-]

The issue that I foresee is that the point of error becomes decoupled from the UI and the UI doesn't handle a delayed error. Especially if retrofit into existing products.

michaelchisari 4 hours ago | parent | prev [-]

The complexity required of a basic CRUD app versus a client-side optimistic update are worlds apart.

Exhaust all other optimizations before lying to your users about what just happened.

MaoSYJ 6 hours ago | parent | prev [-]

well it has been the standard for non critical feedback.

I would not implement optimistic resolution in key information, prices, for example. They live in the server and backend should keep the total control in the client side, even feedback response time.