Wednesday, September 11, 2019

error message - Should we be optimistic or pessimistic with UI updates on AJAX requests?


We are discussing in our team how best to handle UI updates after a user does something to cause an AJAX request to the server.


Here are options we are considering:




  1. Instantly update the UI and add/update/remove the item that has been changed, even though we don't have a success response from the server yet. We would show an error dialog if the AJAX request failed.

  2. Change the object and show an "updating" state.

  3. Only update the UI when the server actually has returned a success response.


In all 3 cases we would indicate that the application is still busy with the request whilst the AJAX request was still being processed.


Maybe this depends on the action that is being performed and how important it is. How important is it to be consistent with these approaches?




No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...