-
-
Notifications
You must be signed in to change notification settings - Fork 154
Race condition between cache check and loadIfNeeded() #237
Copy link
Copy link
Closed
Description
When instantiating a Resource, Siesta checks for cached data asynchronously, updating the resource later if there is a cache hit (and if the resource hasn’t loaded fresh data in the meantime). This is good, but it creates a race condition where loadIfNeeded may initiate a network request if called before the cache check is done.
Instead, loadIfNeeded() should return a chained request that first waits for the cache check if there is one in progress, and only chains to the a network request if the we got a cache miss.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels