Skip to content

Updater downloads IDE without user approval #848

Closed
@per1234

Description

@per1234

Describe the bug

Arduino IDE now has an auto update capability (#797).

This consists of two important components:

  • A check for and notification of available updates.
  • Installation of updates upon approval from the user.

🐛 The IDE is downloading the available update before asking the user whether they want it.

To Reproduce

  1. Start the IDE.

  2. Open the "Command Palette".
    (Ctrl+Shift+P or Command+Shift+P by default)

  3. Run the "Preferences: Open Settings (UI)" command.

  4. Change the "Arduino › Ide: Update Channel" (arduino.ide.updateChannel) setting to "nightly".
    (updates from "stable" channel are currently failing: The built-in IDE updater does not work with my snapshot build #843)

  5. Select File > Quit from the Arduino IDE menus.
    (This is necessary because the channel setting change is only recognized after a restart: Update channel setting change recognized only after IDE restart #847)

  6. Delete the %LOCALAPPDATA%/arduino-ide-updater folder.
    (This is done to prove that the file you find there later did not already exist.)

  7. Start the IDE from command line.

  8. Wait a long time.
    (because it is a big download)

  9. Check the command line output.
    🐛 The output shows that the IDE was downloaded:

    Checking for update
    
    [...]
    
    Cannot download differentially, fallback to full download: Error: Cannot download "https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-20220219_Windows_64bit.exe.blockmap", status 404:
        at ClientRequest.<anonymous> (C:\ide 2\arduino-ide_2.0.0-rc4-snapshot-101d7b9_Windows_64bit\resources\app\node_modules\electron-updater\node_modules\builder-util-runtime\out\httpExecutor.js:229:34)
        at ClientRequest.emit (node:events:394:28)
        at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:105:6816)
        at SimpleURLLoaderWrapper.emit (node:events:394:28)
    
    [...]
    
    New version 2.0.0-rc4-nightly.20220219-nightly-20220219 has been downloaded to C:\Users\per\AppData\Local\arduino-ide-updater\pending\arduino-ide_nightly-20220219_Windows_64bit.exe
    
  10. Check the contents of %LOCALAPPDATA%/arduino-ide-updater/pending
    🐛 The folder contains a new ~160 MB file.

  11. Delete the %LOCALAPPDATA%/arduino-ide-updater folder.
    (This is done to prove that the file you find there later did not already exist.)

  12. Open the "Command Palette".

  13. Run the "Arduino: Check for Arduino IDE updates" command.
    🐛 The output shows that the IDE was downloaded:

    Checking for update
    Found version 2.0.0-rc4-nightly.20220219-nightly-20220219 (url: arduino-ide_nightly-20220219_Windows_64bit.exe)
    Downloading update from arduino-ide_nightly-20220219_Windows_64bit.exe
    Download block maps (old: "https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-20220219_Windows_64bit.exe.blockmap", new: https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-20220219_Windows_64bit.   exe.blockmap)
    Cannot download differentially, fallback to full download: Error: Cannot download "https://downloads.arduino.cc/arduino-ide/nightly/arduino-ide_nightly-20220219_Windows_64bit.exe.blockmap", status 404:
        at ClientRequest.<anonymous> (C:\ide 2\arduino-ide_2.0.0-rc4-snapshot-101d7b9_Windows_64bit\resources\app\node_modules\electron-updater\node_modules\builder-util-runtime\out\httpExecutor.js:229:34)
        at ClientRequest.emit (node:events:394:28)
        at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:105:6816)
        at SimpleURLLoaderWrapper.emit (node:events:394:28)
    New version 2.0.0-rc4-nightly.20220219-nightly-20220219 has been downloaded to C:\Users\per\AppData\Local\arduino-ide-updater\pending\arduino-ide_nightly-20220219_Windows_64bit.exe
    
  14. Check the contents of %LOCALAPPDATA%/arduino-ide-updater/pending
    🐛 The folder contains a new ~160 MB file.

Expected behavior

The update check only checks to see if an update is available.

The IDE download should occur only after the user approves the update by clicking the Download button on the update dialog:

image

Desktop

  • OS: Windows 10
  • Version: 2.0.0-rc4-snapshot-101d7b9
    Date: 2022-02-18T16:03:36.097Z
    CLI Version: 0.21.0 [10107d24]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions