-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
feat(cloudflare): allow prefix
on createWorkersKVSessionStorage
#13778
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
feat(cloudflare): allow prefix
on createWorkersKVSessionStorage
#13778
Conversation
🦋 Changeset detectedLatest commit: f20b033 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
prefix
on createWorkersKVSessionStorare
Co-authored-by: Tim Dorr <timdorr@users.noreply.github.com>
prefix
on createWorkersKVSessionStorare
prefix
on createWorkersKVSessionStorage
We should probably open an RFC for this to follow the new process. I think this seems handy - but wonder if an optional |
I hope you don't mind - I'm using this PR to test out the new alpha release workflow since I haven't tested that on a PR from a forked repo yet :) Update: it failed 🙃 - looks like I need to dig into the workflow permissions from forked repos so I'll do that separately |
I'm going to close this for now according to the new Open Governance model - let's open a Proposal and then if it moves along we can re-open this PR |
This is something I'm doing myself in a project and I think it would be useful to have directly in React Router for others as well.
Right now using
createWorkersKVSessionStorage
fills your Worker KV of keys like64eb4897d922128d
, if you don't use a KV exclusively for your sessions you can make it really hard to use CF Worker KV Dashboard to inspect the keys.There's also no way to list every session and delete them, e.g you can't do this:
This small change adds an optional
prefix
option that can be used to solve this, so you can now do:And now this session storage will add
session:
to every key ending up with something likesession:64eb4897d922128d
which can be easily be listed and work with using KV bindings.