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

🐛 BUG: unstable_dev ignores persist flag (when disabling) #3652

Open
its-jman opened this issue Jul 21, 2023 · 1 comment
Open

🐛 BUG: unstable_dev ignores persist flag (when disabling) #3652

its-jman opened this issue Jul 21, 2023 · 1 comment
Assignees
Labels
bug Something that isn't working unstable_dev Relating to existing unstable_dev

Comments

@its-jman
Copy link

its-jman commented Jul 21, 2023

Which Cloudflare product(s) does this pertain to?

Wrangler core

What version(s) of the tool(s) are you using?

3.3.0

What version of Node are you using?

No response

What operating system are you using?

Mac

Describe the Bug

When using unstable_dev in tests, I've run into an issue where it is persisting states across test runs.

I have been able to resolve it by patching wrangler locally to always disable persisting, but the problem originates here. startDevServer only accepts localPersistencePath as a prop, but getLocalPersistencePath function only checks persistTo, not persist here:

diff --git a/node_modules/wrangler/wrangler-dist/cli.js b/node_modules/wrangler/wrangler-dist/cli.js
index 7e70023..4a6c9dd 100644
--- a/node_modules/wrangler/wrangler-dist/cli.js
+++ b/node_modules/wrangler/wrangler-dist/cli.js
@@ -149668,7 +149668,7 @@ async function startApiDev(args) {
       upstreamProtocol,
       localProtocol: args.localProtocol ?? configParam.dev.local_protocol,
       localUpstream: args.localUpstream ?? host,
-      localPersistencePath,
+      localPersistencePath: null,
       liveReload: args.liveReload ?? false,
       accountId: configParam.account_id ?? getAccountFromCache()?.id,
       assetPaths,

This is the code to replicate

worker = await unstable_dev('./src/__test__/worker1.ts', {
	persist: false,
	experimental: {disableExperimentalWarning: true, disableDevRegistry: true},
	durableObjects: [
		{
			class_name: 'Storage',
			name: 'STORAGE',
		},
	],
})

Please provide a link to a minimal reproduction

No response

Please provide any relevant error logs

No response

@its-jman its-jman added the bug Something that isn't working label Jul 21, 2023
@admah
Copy link
Contributor

admah commented Oct 30, 2023

Hello @its-jman 👋 Sorry for the delay on getting back to you about this issue. This looks to be a result of removing the --persist flag in v3. We'll take a look into the best way to handle this moving forward.

cc: @mrbbot @RamIdeas

@RamIdeas RamIdeas self-assigned this Nov 13, 2023
@lrapoport-cf lrapoport-cf added the unstable_dev Relating to existing unstable_dev label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working unstable_dev Relating to existing unstable_dev
Projects
Status: Backlog
Development

No branches or pull requests

4 participants