An error while fetching breaks the store
Expected behavior
If internet is disconnected for example, the store should fails to return a value. If internet comes back, it should succeed to return this same value if called again
What's happening?
Today, when we try to fetch a value, we add the uri to a loading list, to prevent us from fetching the same resource multiple times at the same time.
But if the fetch fails, we do not remove the id from this loading list. which means that if we call it again, the store thinks the value is still fetching, and does not retry the request
Steps to reproduce
- In a console, type
store.getData('https://api.alpha.happy-dev.fr/users/')
- Turn internet off before the requests succeed
- In the console, type
store.loadingList
. The result will be:["https://api.alpha.happy-dev.fr/users/"]
. It means that ifstore.getData('https://api.alpha.happy-dev.fr/users/')
is called again, the request will not be executed
- related issues: applications/hubl#440 (closed)