Our team also runs into this issue. Dealing in real time means real time changes. Even if we have to wait on an return from the database to the api to the client.
So we simulate the changes as the user makes the action, 'optimistic UI updating' and then wait for confirmation on the server to persist the data. During that waiting period, we tell the user that their changes are being saved, but they are free to do what ever they wish.
It lets the user know things are happening, but might not persist because we are still in the mode of saving, yet allows the user to carry on with their tasks while we deal with the information they send us.
If they close the page, during this time, they are well aware that the changes are happening. The request has been made, it just didn't return yet.
So we simulate the changes as the user makes the action, 'optimistic UI updating' and then wait for confirmation on the server to persist the data. During that waiting period, we tell the user that their changes are being saved, but they are free to do what ever they wish.
It lets the user know things are happening, but might not persist because we are still in the mode of saving, yet allows the user to carry on with their tasks while we deal with the information they send us.
If they close the page, during this time, they are well aware that the changes are happening. The request has been made, it just didn't return yet.