question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Auto-updater does not find new releases from the same day.

See original GitHub issue

Describe the bug The auto-updater does not find new releases if they are released in the same day as the most recent release.

To Reproduce

  1. Create a new release draft.
  2. Publish the release.
  3. Repeat steps 1 and 2 in the same day.
  4. Attempt to have auto-update work.

Expected behavior If the latest.yml in /<repo>/releases/latest has a different version than the current, it should be considered the latest.

Screenshots N/A

Additional context This seems to stem from the fact that in semantic versioning, v1.2.3-456, the 456 would be considered a pre-release. It might be best to identify a way to utilize package.json and npm version to use proper semantic versioning for releases to avoid this problem.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cawa-93commented, Oct 15, 2022

In case anyone else stumbles across this, here’s a little workaround for the automatic release process. In .electron-builder.config.js, remove one . character in the version string (the one that separates month from day) and replace the - with a .. Basically, you want to turn 22.10.15-575 into 22.1015.575.

if (process.env.VITE_APP_VERSION === undefined) {
  const now = new Date()
  process.env.VITE_APP_VERSION = `${now.getUTCFullYear() - 2000}.${
    now.getUTCMonth() + 1
  }${now.getUTCDate()}.${now.getUTCHours() * 60 + now.getUTCMinutes()}`
}

The next day, all of your old installs will probably auto update. But for new installations, this solution works immediately. Electron will auto update immediately when it detects a new version online. This is because semver now treats the new release as a new release instead of a small update.

Then you will got: 22.1.31 -> 22.131 22.2.1 -> 22.21 Second is newest version but according to semver is oldest because 21 < 131.

Using day of year should solve it. I’ll try to make the appropriate changes ASAP (if the fuckingRussians don’t launch missiles into my city)

0reactions
cawa-93commented, Nov 14, 2022

Now app version just reading from root package.json. You can implement your own versioning logic in getVersion() See change note: https://github.com/cawa-93/vite-electron-builder/discussions/870

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoupdate downloads new update, but does not successfully ...
You can see my releases from yesterday on github, I got that part working. However, my ultimate goal is to get auto update...
Read more >
electron updater notify for new release but do not update or ...
electron updater 4.2.0 package do not download new release but can detect it. This is a private repository on github.
Read more >
AutoUpdater Utility - Check Point Support Center
AutoUpdater is a Check Point process responsible for automatic updates. The latest updates are installed automatically on all relevant Check ...
Read more >
Auto Updater - About the Documentation - Proofpoint
Auto Updater checks which version is currently installed on the endpoint and ... This way, you do not need to install new versions...
Read more >
Release history for Microsoft AutoUpdate (MAU)
Therefore, you might receive a notification to update Microsoft AutoUpdate even if you're not running Office for Mac. To view release notes, see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found