In my app, I have a settings page with a number of options that all need to be saved on our backend. The call to the backend may fail for connectivity reasons and I'm not sure what's the best way to tackle it. Here are the options I thought about, maybe I missed some:
Optimistic individual change
Every time a setting changes, call the backend and visually reflect the change. If the backend call fails, show a toast and revert the change.
Advantages: seamless, user knows when there's an issue asap
Drawbacks: more backend calls, state management can be a pain
Pessimistic individual change
Every time a setting changes, call the backend with a progress dialog disabling interaction until the call is done
Advantages: user knows when there's an issue, easier to manage state
Drawbacks: more backend calls, lots of friction
Optimistic global change
Only call the backend when leaving the settings activity and visually reflect changes. If the backend call fails, show a toast and revert changes
Advantages: seamless, one single call
Drawbacks: user doesn't know about issues before leaving, has to come back and redo everything
Pessimistic global change
Only call the backend when leaving the settings activity with a progress dialog disabling interaction until the call is done
Advantages: one single call, easiest to manage
Drawbacks: user doesn't know about issues before leaving, has to come back and redo everything (I don't want to lock the user in the page if the save fails)
Note that the issues will be related to connectivity most of the time as the app prevents from sending invalid input, so no error messages to display on particular fields.
What would the best practice for this, in particular on Android? I've tried to get inspiration from existing apps with good UX but I can't seem to find a common pattern.