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

Using nsis and nsis-web uploads latest.yml twice #8794

Open
andidev opened this issue Jan 22, 2025 · 1 comment
Open

Using nsis and nsis-web uploads latest.yml twice #8794

andidev opened this issue Jan 22, 2025 · 1 comment

Comments

@andidev
Copy link

andidev commented Jan 22, 2025

  • Version: 25.1.8

  • Target: build --win --x64 --ia32 -p always

    "win": {
      "target": ["nsis", "nsis-web"]
    },
    publish: {
        provider: 's3',
        ...,
    }

Will publish bot nsis and nsis-web installers/update files.
However it will also upload the latest.yml twice for nsis and nsis-web.
And there is a race condition and I have noted that the one that wins is random and overwrites the first.
Update will work either way but will download more data if nsis wins to upload its latest.yml since it contains the --x64 --ia32 architectures.

Maybe a good solution would be to only upload latest.yml for nsis-web in these cases?
Or at least add a config option to disable the upload of latest.yml per target so nsis latest.yml can be ignored?

@andidev andidev changed the title Using 'nsis', 'nsis-web' uploading latest.yml uploaded a race condition Using nsis and nsis-web uploads latest.yml twice Jan 22, 2025
@mmaietta
Copy link
Collaborator

So I took a look at the code, and I don't think it was ever expected to have both nsis and nsis-web targets for updating. My guess is that they're duplicating intent, it probably was assumed by design that anyone looking to distribute an NSIS installer but use nsis-web wouldn't need the individual nsis artifacts as well for updating?

The auto-update docs state only nsis is supported for auto-update, so I'm not surprised there's a collision between the nsis and nsis-web latest.yml.

The problem with your suggestion is that it'll break auto-update for nsis, as the latest.yml are entirely different objects and not mergeable:
nsis

version: 1.0.4
files:
  - url: electron-quick-start-typescript-Setup-1.0.4.exe
    sha512: Khz7sieUavOJpdrfJhlU2GuxLserSmPSb3ead/09+KTdVWMfrEwP6lHKu4qGZaOHoStdjNjGKJmhcJLs1ZfglQ==
    size: 134434016
    isAdminRightsRequired: true
path: electron-quick-start-typescript-Setup-1.0.4.exe
sha512: Khz7sieUavOJpdrfJhlU2GuxLserSmPSb3ead/09+KTdVWMfrEwP6lHKu4qGZaOHoStdjNjGKJmhcJLs1ZfglQ==
releaseDate: '2025-01-23T02:34:10.488Z'

nsis-web

version: 1.0.4
files:
  - url: electron-quick-start-typescript-Web-Setup-1.0.4.exe
    sha512: GodiKxm6tPnq54Oo7GUd2YkbKl4LXUrcOwBKqHYcsC1eJIf1EhqUGeJR2kaBSWuSA8eV4UK3gDPwstglD1TuOg==
path: electron-quick-start-typescript-Web-Setup-1.0.4.exe
sha512: GodiKxm6tPnq54Oo7GUd2YkbKl4LXUrcOwBKqHYcsC1eJIf1EhqUGeJR2kaBSWuSA8eV4UK3gDPwstglD1TuOg==
packages:
  ia32:
    size: 65338747
    sha512: SgJ7McZ5NGJuIf/tH8o+wche87r9H1E/m0FdfMcPwKXT3ihhnd1H2peLf3lv/64Df3RdfHC3dJQGJEvAZE0K8A==
    blockMapSize: 61804
    path: electron-quick-start-typescript-1.0.4-ia32.nsis.7z
    file: electron-quick-start-typescript-1.0.4-ia32.nsis.7z
  x64:
    size: 68708419
    sha512: EcuIKf6qcxGMRUQ6QyGukJ4MKpSFbgLWVouPH8oFLWqfpADIqiRT2656sxHuJMS8ALCLkvlMcCAqCHwMPOPUwA==
    blockMapSize: 66613
    path: electron-quick-start-typescript-1.0.4-x64.nsis.7z
    file: electron-quick-start-typescript-1.0.4-x64.nsis.7z
isAdminRightsRequired: true
releaseDate: '2025-01-23T02:34:10.488Z'

TLDR; AFAICT, I can't change the behavior to support both deployments w/ both auto-updates. It wasn't designed to.

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