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

conflict between mounts in getKeys #27

Closed
farnabaz opened this issue Sep 28, 2021 · 0 comments · Fixed by #45
Closed

conflict between mounts in getKeys #27

farnabaz opened this issue Sep 28, 2021 · 0 comments · Fixed by #45

Comments

@farnabaz
Copy link
Collaborator

Assume

/tmp <------- mount point
/tmp/s1-1
/tmp/s1-2/
/tmp/s1-2/s1-2-1
/tmp/s1-3
/tmp/s1-2 <------- mount point
/tmp/s1-2/s2-1
/tmp/s1-2/s2-2
/tmp/s1-2/s2-3

When we call storage.getKeys('/tmp/s1-2') we get:

/tmp/s1-2/s1-2-1 <---- This is odd behavior.
/tmp/s1-2/s2-1
/tmp/s1-2/s2-2
/tmp/s1-2/s2-3

having /tmp/s1-2/s1-2-1 in result keys is odd, and leads to invalid behavior. Since calling storage.getItem('tmp:s1-2:s1-2-1') result null


const storage = createStorage()
const storage1 = createStorage()
storage1.setItem('s1-1', 'bar')
storage1.setItem('s1-2/s1-2-1', 'bar')
storage1.setItem('s1-3', 'bar')
const storage2 = createStorage()
storage2.setItem('s2-1', 'bar')
storage2.setItem('s2-2', 'bar')
storage2.setItem('s2-3', 'bar')
storage.mount('/tmp', storage1)
storage.mount('/tmp/s1-2', storage2)

const keys = await storage.getKeys('/tmp/s1-2')

const content = await storage.getItem('tmp:s1-2:s1-2-1') # null
pi0 added a commit that referenced this issue May 2, 2022
@pi0 pi0 closed this as completed in #45 May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant