-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abort Stale Invalidation Request #5305
Comments
Closes #6354. Related to #6489, #6274 and #5305 Co-authored-by: Rich Harris <[email protected]> Co-authored-by: icalvin102 <[email protected]> Co-authored-by: Immanuel Calvin Herchenbach <[email protected]>
I think the problem is not a race condition, but that |
* [fix] tighten up navigation and invalidation logic - Fixes #6844, invalidation is now only reset after navigation settled - Fixes #5305, newer invalidations are no longer swalloed by ongoing older ones - Fixes #6902, the pending prefetch is reset upon invalidation * fix redirect token logic * batch synchronous invalidations * tests * tweak load cache timing and reduce code a little * Apply suggestions from code review Co-authored-by: Rich Harris <[email protected]> * lint Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Rich Harris <[email protected]>
hello, im facing this issue, where i have to run several invalidations that can overlap, but im only interested on the last one and i can't find any way to abort the staled invalidations. any help or workarounds on how to do so, would be very appreciated |
Describe the problem
Consider the scenario where several invalidate requests to the same dependency are triggered in rapid succession (say because of an updating query parameter, e.g.
?search=foo
).The order in which these requests return from the server is not guaranteed, which means it's possible that the last resolving revalidation will be stale.
Describe the proposed solution
I wonder if we allow an optional abort signal, where
AbortSignal
implements the canonical Abort API.Alternatives considered
Sveltekit's invalidate function could manage this automatically, but I worry there are scenarios where one might need multiple inflight invalidation requests.
Importance
would make my life easier
Additional Information
As always, thanks so much for all the great work! Sveltekit is such a gamechanger for NYTs!
The text was updated successfully, but these errors were encountered: