Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain the difference here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are now making the request, regardless of whether the data was found in IndexedDB or not, so we serve the stale data in the mean time, but invalidate the stale cache with the request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know some of the copy and move commands are fairly rapid-fire, so this could produce a lot of requests. I'm not sure of the impact but combined with the other recent change I made, the net result could not be so great. This doesn't necessarily help that, but what if in the case when we do have a copy locally, we instead put the
requestModelcall in the next tick?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the overall effect of the indirection in
requestModeldoes mean that it gets shunted out of the main thread and picked up later. I could also add the same sort of request sharing that we are using forrequestCollectionwhere we maintain the fetch promise for 5 seconds and just pass it back if the same request is made again.