Vodes / Styx-Common-Compose

Common compose components and utils library for Styx-related KMP projects
Mozilla Public License 2.0
0 stars 0 forks source link

Storage bugs when data fetching failed #1

Open Vodes opened 2 months ago

Vodes commented 2 months ago

In the scenario of an unstable network (as is very likely on a mobile device) a getList request might fail and we don't currently handle this properly. It just saves an empty list and Storage.needsRefresh checks if that list is empty so it keeps looping without ever updating the data because of this check.

Might want to implement a result class with an http code, exception if any and resulting list if any and either load again if any of the two media requests failed or set the localChange of the failed requests to 0.

Vodes commented 2 months ago

The looping in question looks something like this.

https://github.com/user-attachments/assets/b83f09ef-cc25-4783-985b-03294513f828

Once it gets past that screen everything will be unresponsive as hell because the needsRefresh check gets called every time any data is requested and it keeps requesting the current data from the server.