Anyone knows a good template to ensure user interface consistency when using ultimately consistent data updates

A script is a grid with a list of contacts. The user clicks "Send Email" from the network, sends an email. We send a message to the queue to update some units (which also appear in the list).

Problems arise after sending e-mail, units are not guaranteed to be updated.

We could update the score using javascript, but what if they refresh the page and the aggregates are not completed yet?

+5
source share
1 answer

One approach is to track data in a cookie. When refreshing (i.e. loading the page), you can check for the existence of a cookie and read (and display) its value using JavaScript. A process that updates aggregates can also read a cookie and update it, if necessary, to ensure that the values ​​are synchronized after the updates are completed.

+1
source

All Articles