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

Don't suggest to upgrade to lower version #192

Merged
merged 4 commits into from
Sep 29, 2020
Merged

Don't suggest to upgrade to lower version #192

merged 4 commits into from
Sep 29, 2020

Conversation

fregante
Copy link
Contributor

@fregante fregante commented Sep 24, 2020

Fixes #181

I haven't investigated why this would happen in the first place, but I guess it could if you install a beta version.

Is that a bug in https://github.com/sindresorhus/latest-version?

@fregante fregante marked this pull request as ready for review September 24, 2020 00:25
@sindresorhus
Copy link
Owner

Is that a bug in sindresorhus/latest-version?

Not sure, but I don't think so, since I've seen this problem happen on non-beta versions too.

@sindresorhus sindresorhus merged commit 3dfe42d into sindresorhus:master Sep 29, 2020
@fregante fregante deleted the patch-1 branch September 29, 2020 16:28
@fregante
Copy link
Contributor Author

Yeah the 2 comments were unrelated. I think latest-version could return a version older than its supposed to, I don’t know what else could be happening. Is it still cached here?

@fregante fregante restored the patch-1 branch September 29, 2020 16:30
kmcnellis added a commit to firebase/firebase-tools that referenced this pull request Apr 16, 2021
Update to a version that includes sindresorhus/update-notifier#192 to avoid the bug where it will suggest downgrading your version (sindresorhus/update-notifier#181).
kmcnellis added a commit to firebase/firebase-tools that referenced this pull request Apr 16, 2021
Update to a version that includes sindresorhus/update-notifier#192 to avoid the bug where it will suggest downgrading your version (sindresorhus/update-notifier#181).
kmcnellis added a commit to firebase/firebase-tools that referenced this pull request Apr 16, 2021
Update to a version that includes sindresorhus/update-notifier#192 to avoid the bug where it will suggest downgrading your version (sindresorhus/update-notifier#181).
kmcnellis added a commit to firebase/firebase-tools that referenced this pull request Apr 19, 2021
Update to a version that includes sindresorhus/update-notifier#192 to avoid the bug where it will suggest downgrading your version (sindresorhus/update-notifier#181).
ghost pushed a commit to snyk/cli that referenced this pull request Apr 26, 2021
Older verions of update-notifier suggested updating to older versions. See sindresorhus/update-notifier#192
@slorber
Copy link

slorber commented May 13, 2021

Hi,

Not sure it's related but we got those messages reported here:

image

facebook/docusaurus#4782

Any idea what could be happening?

@slorber
Copy link

slorber commented May 13, 2021

Looks like this bug is caused by the async nature of this package: fetch the update, and only notify about it on the 2nd run.

As I have my own code to notify users, I think I should just backport your logic to my own notifier.

Wouldn't it make sense to somehow "erase" this.update data if on 2nd run we detech packageVersion is > latest fetched version? This could fix the issue in a more generic way?

slorber added a commit to facebook/docusaurus that referenced this pull request May 13, 2021
devpeerapong pushed a commit to devpeerapong/firebase-tools that referenced this pull request Dec 14, 2021
Update to a version that includes sindresorhus/update-notifier#192 to avoid the bug where it will suggest downgrading your version (sindresorhus/update-notifier#181).
kodiakhq bot pushed a commit to vercel/vercel that referenced this pull request May 31, 2022
Looks like this is a bug in update-notifier, but they [smoothed it over](sindresorhus/update-notifier#192) with a change that was deployed in [`5.0.0`](https://github.com/yeoman/update-notifier/releases/tag/v5.0.0). We’re currently on `4.1.0`.

This can cause an update notification for a PREVIOUS version, like so:

```
$  vc --version
> UPDATE AVAILABLE Run `npm i -g vercel@latest` to install Vercel CLI 24.2.5-canary.3
> Changelog: https://github.com/vercel/vercel/releases/tag/[email protected]
Vercel CLI 24.2.5
24.2.5
```

While we're here, also sets the [`updatecheckinterval`](https://github.com/yeoman/update-notifier#updatecheckinterval) to 1 week.

---

Previous PR: #4896
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 this pull request may close these issues.

It just suggested a version downgrade to me
3 participants