-
Notifications
You must be signed in to change notification settings - Fork 803
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: --experimental-enable-local-persistence
stores KV, Durable Objects and Cache data in the same directory
#830
Comments
good catch! we'll fix this. thank you for reporting! |
threepointone
added a commit
that referenced
this issue
Apr 24, 2022
With `--experimental-enable-local-persistence` in `dev`, we were clobbering a single folder with data from kv/do/cache. This patch gives individual folders for them. It also enables persistence even when this is not true, but that stays only for the length of a session, and cleans itself up when the dev session ends. Fixes #830
threepointone
added a commit
that referenced
this issue
Apr 25, 2022
With `--experimental-enable-local-persistence` in `dev`, we were clobbering a single folder with data from kv/do/cache. This patch gives individual folders for them. It also enables persistence even when this is not true, but that stays only for the length of a session, and cleans itself up when the dev session ends. Fixes #830
threepointone
added a commit
that referenced
this issue
Apr 25, 2022
…839) With `--experimental-enable-local-persistence` in `dev`, we were clobbering a single folder with data from kv/do/cache. This patch gives individual folders for them. It also enables persistence even when this is not true, but that stays only for the length of a session, and cleans itself up when the dev session ends. Fixes #830
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What version of
Wrangler
are you using?0.0.26-ee3475f
What operating system are you using?
Mac
Describe the Bug
Wrangler 2 sets Miniflare's
kvPersist
,durableObjectsPersist
andcachePersist
options to the same string path value when--experimental-enable-local-persistence
is enabled:https://github.com/cloudflare/wrangler2/blob/9d04a6866099e77a93a50dfd33d6e7707e4d9e9c/packages/wrangler/src/dev/local.tsx#L175-L182
This means KV namespaces, Durable Objects, or caches using the same name will share data.
As an example, consider the following worker:
This returns the following response, even though no data was written to the
test
KV namespace:Running
tree
shows the problem here:The
test
directory is being shared by the KV namespace and the cache.A solution here is to put KV namespaces, Durable Objects and caches in their own subdirectories, by adding a unique path segment to the end of
localPersistencePathOrDisableLocalPersistence
for each ofkvPersist
,durableObjectsPersist
andcachePersist
.The text was updated successfully, but these errors were encountered: