You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The response returned from request is after the user mutating the model.
Suppose useInfiniteFetch fetch a post list with id from 1 to 10, and useFetch fetch the post with id 1 later. But the response from useFetch may be in front of the response from useInfiniteFetch. In this case, we will update the model with expired response.
The text was updated successfully, but these errors were encountered:
It seems that we cannot resolve the second case because the model is defined from the user. However, we can pass the start time to the syncModel method such that the user can determine which data is expired.
It may be good if pagination adapter can record the timestamp. However, I need to be careful not to make the API too complex, or else it would be counterproductive.
In the second case, if the API for the post list is newer than the API for getting a single post, discarding the "get post" API may result in receiving incomplete data. This is because the list API usually does not return complete information. I might need to abandon this case.
There are two case of the race condition.
useInfiniteFetch
fetch a post list with id from 1 to 10, anduseFetch
fetch the post with id 1 later. But the response fromuseFetch
may be in front of the response fromuseInfiniteFetch
. In this case, we will update the model with expired response.The text was updated successfully, but these errors were encountered: