We want to update the UI immediately after a user interaction. Depending on the network quality, waiting for a network request to complete can be perceived as "lag" or a performance issue with the app. We also want to allow the user to
add reminders
toggle homework/notifications as done
in offline mode. This requires updating the internal app state before a network request has completed.
I intend to add an api to register actions that have to be executed with an active internet connection. They will be registered as (actionName, payload), where payload is a BuiltValue. The corresponding middleware registers its action if there is a failure that seems to be related to a newtork issue, or if the entire app is in offline mode already.
TODO: Should we use that occasion to check whether the internet connection is back?
Then, if later a network login succeeds, we will loop through the actions and re-dispatch them to bring the server state back in sync with the app state. Only after that normal loading can proceed. (Show a spinner in the meantime?)
We want to update the UI immediately after a user interaction. Depending on the network quality, waiting for a network request to complete can be perceived as "lag" or a performance issue with the app. We also want to allow the user to
in offline mode. This requires updating the internal app state before a network request has completed. I intend to add an api to register actions that have to be executed with an active internet connection. They will be registered as (actionName, payload), where payload is a
BuiltValue
. The corresponding middleware registers its action if there is a failure that seems to be related to a newtork issue, or if the entire app is in offline mode already. TODO: Should we use that occasion to check whether the internet connection is back? Then, if later a network login succeeds, we will loop through the actions and re-dispatch them to bring the server state back in sync with the app state. Only after that normal loading can proceed. (Show a spinner in the meantime?)