-
Notifications
You must be signed in to change notification settings - Fork 734
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
Warn when wrangler dev is being used on a worker that binds to a durable object class implemented by a different script #319
Comments
Is there any technical reason we can't use the same dirty-write mechanic for DOs that are owned by another script? It makes sense for us in the meantime to surface a warning (maybe even a hard error?), but it would also be nice if we didn't need to do that in the first place. |
It's technically plausible, but would be quite a lot of work in both the runtime and the config service to support running the transitive closure of all depended-upon scripts in the preview session for a given script. |
Durable Objects that are being bound by `script_name` will not be isolated from the live data during development with `wrangler dev`. This change simply warns the developer about this, so that they can back out before accidentally changing live data. Fixes cloudflare#319
Durable Objects that are being bound by `script_name` will not be isolated from the live data during development with `wrangler dev`. This change simply warns the developer about this, so that they can back out before accidentally changing live data. Fixes cloudflare#319
Durable Objects that are being bound by `script_name` will not be isolated from the live data during development with `wrangler dev`. This change simply warns the developer about this, so that they can back out before accidentally changing live data. Fixes cloudflare#319
Durable Objects that are being bound by `script_name` will not be isolated from the live data during development with `wrangler dev`. This change simply warns the developer about this, so that they can back out before accidentally changing live data. Fixes #319
When a script containing a DO implementation is previewed using wrangler dev, the DO instances accessed in the preview session will have read access to the storage used by real objects in the real version of the namespace, but writes will be kept in memory and won't affect prod data.
However, if a script binds to a DO namespace implemented by a different script (or even if it's in the same script being previewed but the
script_name
is specified in the DO binding), then any requests sent by the preview session to DOs in that namespace will hit the real objects and any writes will modify the real prod data in that namespace. This is how KV works in preview too, but it's more confusing for DOs because of the fact that we do a copy-on-write overlay in the common case where the DO implementation is in the same script.We should log a warning when
wrangler dev
is used on a script that has a DO binding that will be affected by this, giving the user a chance to acknowledge that they're sure they're ok with their preview session potentially overwriting real live data stored in the DOs.The text was updated successfully, but these errors were encountered: