miDeb / digitales_register

Inoffizielle App für das Digitale Register (https://digitalesregister.it)
GNU General Public License v3.0
16 stars 3 forks source link

Add an api to facilitate ui changes before the network request has succeeded #2

Open miDeb opened 3 years ago

miDeb commented 3 years ago

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?)