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

before doesn't work without fullMetadata #30

Closed
altano opened this issue Feb 24, 2020 · 4 comments
Closed

before doesn't work without fullMetadata #30

altano opened this issue Feb 24, 2020 · 4 comments

Comments

@altano
Copy link

altano commented Feb 24, 2020

The undocumented fullMetadata option is required to fetch times, and without this the before flag appears to not work.

Repro:

$ npm view safe-write-stream time 
{
  ...
  '1.0.4': '2016-02-07T00:21:03.628Z', <=== Expected when specifying before: 2017-01-01
  '1.0.5': '2017-02-09T03:26:22.308Z'
}

fullMetadata: undefined
node -e "require('pacote').manifest('safe-write-stream@^1.0.4', { before: new Date('2017-01-01') }).then(r => console.log(r.version));"
Result: 1.0.5 ❌

fullMetadata: false
node -e "require('pacote').manifest('safe-write-stream@^1.0.4', { fullMetadata: true, before: new Date('2017-01-01') }).then(r => console.log(r.version));"
Result: 1.0.4 ✔

@isaacs
Copy link
Contributor

isaacs commented Feb 24, 2020

Ahh!! Ok, we looked at this and initially thought it was already fixed, but it turns out even though we're setting this.fullMetadata based on a before option, that flag is not making its way back to the options passed to npm-registry-fetch. Fix coming shortly.

@altano
Copy link
Author

altano commented Feb 25, 2020

Amazingly fast turnaround, thanks!

@isaacs
Copy link
Contributor

isaacs commented Feb 25, 2020

It helps that you posted a bug on a module that we're currently in the midst of editing for other reasons 😆

@altano
Copy link
Author

altano commented Feb 25, 2020

Makes sense. I’ll make sure to only find bugs in actively developed projects from now on. :p

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

No branches or pull requests

3 participants