Skip to content
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

fix: add warning about wrangler dev with remote Durable Objects #687

Conversation

petebacondarwin
Copy link
Contributor

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

@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2022

🦋 Changeset detected

Latest commit: b9bb4c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2035829987/npm-package-wrangler-687

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/687/npm-package-wrangler-687

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2035829987/npm-package-wrangler-687 dev path/to/script.js

@petebacondarwin petebacondarwin force-pushed the warn-on-durable-objects-in-different-script branch from 45eba66 to c66d1d7 Compare March 24, 2022 18:02
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
@petebacondarwin petebacondarwin force-pushed the warn-on-durable-objects-in-different-script branch from c66d1d7 to b9bb4c9 Compare March 24, 2022 18:04
Copy link
Contributor Author

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there are already tests in publish.test.ts that use remote Durable Objects and check that there are no warnings rendered.

@threepointone
Copy link
Contributor

We should also follow up internally and ask for an "environment" that we can pass to the binding, so one could, for example, bind to a staging/non prod environment during dev

@petebacondarwin petebacondarwin merged commit 8f7ac7b into cloudflare:main Mar 25, 2022
@petebacondarwin petebacondarwin deleted the warn-on-durable-objects-in-different-script branch March 25, 2022 11:15
@github-actions github-actions bot mentioned this pull request Mar 25, 2022
@a-robinson
Copy link
Member

Thanks @petebacondarwin !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants