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] calling verify() should not modify the time property #54

Closed
k2s opened this issue May 7, 2021 · 0 comments · Fixed by #199
Closed

[BUG] calling verify() should not modify the time property #54

k2s opened this issue May 7, 2021 · 0 comments · Fixed by #199
Labels

Comments

@k2s
Copy link

k2s commented May 7, 2021

What / Why

Documentation says about property time: Timestamp the entry was first added on.
Running cacache.verify() internally uses insert() method and sets time property to Date.now().
This is not what user expects and it makes the time property unusable.

How

const cachePath = '/tmp/cacache'
const key = 'key'

await cacache.put(cachePath, key, 'hello')
const item1 = await cacache.get.info(cachePath, key)
await cacache.verify(cachePath)
const item2 = await cacache.get.info(cachePath, key)

console.log(item1.time, item2.time, item1.time === item2.time ? 'ok' : 'WRONG')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants