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

Beta/Alpha channels do not fetch Latest version from GitHub when attempting to update #7665

Closed
sethjray opened this issue Jul 13, 2023 · 0 comments

Comments

@sethjray
Copy link
Contributor

  • Electron-Builder Version: 23.6.0
  • Node Version: 18.10.0
  • Electron Version: 23.2.1

  • Electron Type (current, beta, nightly): current

  • Electron-Updater Version: 5.3.0
  • Target: Windows

We are attempting to use the channels feature that was added to electron-updater in #6505. However, there is an issue where if our channel is set to beta or alpha, (v1.4.3-beta on the beta channel for example) autoUpdater does not see the latest release (v1.5.0 for example).

After looking at GitHubProvider.ts, it seems that isCustomChannel is incorrectly being set to true when the release it is checking is latest.
const isCustomChannel = !["alpha", "beta"].includes(String(hrefChannel))
Because of this, all of our latest/stable releases are treated as custom channels and are not downloaded when beta or alpha attempts to look for them and the following error is logged:

autoUpdater error:  Error: No published versions on GitHub
    at newError (C:\Program Files (x86)\Datalogic\Scan2Deploy Studio\resources\app.asar\node_modules\electron-updater\node_modules\builder-util-runtime\out\index.js:47:19)
    at GitHubProvider.getLatestVersion (C:\Program Files (x86)\Datalogic\Scan2Deploy Studio\resources\app.asar\node_modules\electron-updater\out\providers\GitHubProvider.js:94:55)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NsisUpdater.getUpdateInfoAndProvider (C:\Program Files (x86)\Datalogic\Scan2Deploy Studio\resources\app.asar\node_modules\electron-updater\out\AppUpdater.js:319:19)
    at async NsisUpdater.doCheckForUpdates (C:\Program Files (x86)\Datalogic\Scan2Deploy Studio\resources\app.asar\node_modules\electron-updater\out\AppUpdater.js:333:24)

I believe this can be fixed by adding a check for null when assigning a value to isCustomChannel, since that is what hrefChannel will equal when looking at latest/stable releases.
const isCustomChannel = hrefChannel !== null && !["alpha", "beta"].includes(String(hrefChannel));

Please let me know if there's anything I may have misread or left out, and thanks for your time.

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

2 participants