-
-
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
invalidate() method timeout #6274
Comments
This plus #5305, plus a separate conversation about allowing non-URL arguments to |
Allowing a timeout only on |
I was wondering if such an API is really necessary. A user could do something like I was also thinking about what @Conduitry said but I couldn't come up with a common place for this other than the config file which is too broad/not the right place. A thought I had was adding an input method to |
Coming back to this again, my workaround with await Promise.race([
new Promise((_, reject) => setTimeout() => { goto($page.url); reject(); }, 1000),
invalidate('..')
]); This could be packed up into a little helper function. I'm inclined to move this post 1.0 to wait for more people expressing desire to have something like this built in where such a helper function (which also provides way more control, because you can do more than timeout) wouldn't suffice. Other ways this could be solved:
Implementation-wise I think |
Whether we do it now or later, I think the framework should have support built-in for it. And I think it should happen automatically and not require any special APIs. It should probably be configurable both globally and for an individual call |
I still don't see why we would want this on programmatic What would happen if we allowed a If we want to be code-over-configuration about this (at least at first) what about a wrapper function around the whole |
Everything @Conduitry is saying makes sense to me — this isn't an A more declarative approach like
In a certain sense the second makes more sense — Either way it would be a non-breaking change, and the userland solution (higher order functions) can be used today, so I no longer think this needs to be solved pre-1.0. |
Describe the problem
If
invalidate()
is called and the server generates an error, it appears the client is directed to an error page with the appropriate details. ✅But if
invalidate()
is called and there is simply no response, then what? Right now it appears happy to wait forever (where "forever" is at least the 5 minutes I waited). This could lead to inconsistent state if not handled.Should we be expected to add our own timeout mechanism or could a default timeout option be set or
invalidate()
allow a timeout parameter that could generate an error on the client?Describe the proposed solution
Either a global timeout or a per-invalidate timeout, that will generate a timeout error on the client (or a combination of timeout and retry mechanism).
Alternatives considered
No response
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: