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

getItems does not work with prefixStorage #396

Open
harlan-zw opened this issue Feb 7, 2024 · 3 comments
Open

getItems does not work with prefixStorage #396

harlan-zw opened this issue Feb 7, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@harlan-zw
Copy link
Contributor

harlan-zw commented Feb 7, 2024

Environment

1.10.1

Reproduction

https://stackblitz.com/edit/stackblitz-starters-rrstqp?file=index.js

Describe the bug

Working

useStorage().getItems(['namespace:key'])

Not Working

prefixStorage(useStorage(), 'namespace').getItems(['key'])
useStorage('namespace').getItems(['key'])

// { key: "key", value: null }

It seems to switch back to the default driver (memory). I'm guessing this is because the mount is being discovered from the input key, without the base being applied first.

Additional context

No response

Logs

No response

@pi0
Copy link
Member

pi0 commented Feb 7, 2024

Can you please make a sandbox ideally with unstorage only? 🙏🏼

@harlan-zw
Copy link
Contributor Author

Yes, sorry thought it was clear enough. Here is a repro: https://stackblitz.com/edit/stackblitz-starters-rrstqp?file=index.js

Would be great to add a starter to readme for quickly spinning one up.

@harlan-zw harlan-zw changed the title getItems does not work with a storage base getItems does not work with prefixStorage Feb 7, 2024
@dimasxp
Copy link

dimasxp commented Apr 9, 2024

useStorage('namespace').clear() also not working with namespace

@pi0 pi0 added the bug Something isn't working label May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants