-
Notifications
You must be signed in to change notification settings - Fork 335
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
🐛[breaking change] cache no-store
errors break existing setups
#2116
Comments
Same goes for |
no-store
errors break existing setupsno-store
errors break existing setups
Reproduction: Playground Code: export default {
fetch() {
new Request("https://my.web.site", {
cache: "no-store" // This should error, OR
})
return fetch("https://1.1.1.1/cdn-cgi/trace", {
cache: "no-store" // This shouldn't error
});
}
} |
Ok, a little weirder, it does appear that previous versions of |
Oh man. This is like our worst nightmare for trying to maintain compatibility... apps which dynamically probe for the existence of an API and then attempt to use it if it's there. Code paths that were never tested in any capacity suddenly executing in production due to a runtime change. Not blaming the application code, but ugh... I guess this means we have to hide this whole API behind a compat flag. |
I totally feel you and that's one thing for sure but the way I understand the PR's description simply does not match the code |
We are going to roll back the runtime to the version before this change went out. This will take a few hours to propagate everywhere. When we introduce the change again it'll be behind a compat flag. |
Many thanks @kentonv. Similar to what @helloimalastair described, I found that the Azure SDK checks if |
@jannisch The plan is to actually support these settings correctly. This change was a first step towards that, but we failed to account for all the ways people might be probing for the existence of the property. Unfortunately it is apparent that any change at all to the existing behavior risks breaking people -- even if we made the API fully implemented and conformant in a single step, there could still be latent bugs lurking in application code that could kick in as soon as the API becomes available. So, we will need to guard all changes behind a compat flag. This is unfortunate as we usually don't like making people update their compat date to get access to new APIs but it seems unavoidable here. |
Just to be clear, it is always our fault if code in production breaks as a result of a change we made, not the application's fault. I apologize for the breakage here. |
This is specifically to publish a new release that does not suffer from #2116.
I am the user who reported the issue on the |
Is there a workaround ? cache:"no-cache" or "no-store" , is causing this error :The 'cache' field on 'RequestInitializerDict' is not implemented. |
@rishab002 That is the original behavior. The workaround is to not set the |
FWIW, our intent here is to properly implement |
Closing this issue. The change was reverted in production. |
@helloimalastair we are about to reroll out this change behind a compatability flag, we added tests for the behavior you described but we'd like to actively monitor your workers as we deploy this change. Could you tell us the zone name of the worker that broke or alternatively email it to [email protected]. |
@AdityaAtulTewari |
Followup to #2073
The change to support
cache
, while nice, has introduced some issues with libraries that already usedRequestInit.cache
, like@tidbcloud/serverless
(issue), and@azure/cosmos
(discord thread).Libraries built for the browser/other runtimes, which previously worked because thecache
field was just ignored, are now erroring when they attempt to provideno-store
, since it isn't yet implemented.After further investigation, it appears that
@tidbcloud/serverless
was usingnew Request('x:', { cache: "no-store" })
in atry
/catch
to detect whether or not the current runtime supportscache
. The new update appears to allow you to create a request with ano-store
cache
value, but will still error if you try to pass one tofetch()
.Would it be possible to have this field log an issue, but not actually throw, so that these libraries continue working? Or, conversely, have
new Request()
error as it previously did, untilno-store
is supported?The text was updated successfully, but these errors were encountered: