Skip to content

Postponed update is installed on exit #874

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

Open
3 tasks done
per1234 opened this issue Feb 28, 2022 · 9 comments
Open
3 tasks done

Postponed update is installed on exit #874

per1234 opened this issue Feb 28, 2022 · 9 comments
Assignees
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Feb 28, 2022

Describe the problem

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

After downloading an update, the user is offered two options:

image

From #797 (comment)

when a newer version is downloaded, the user can restart the application to apply the new changes, or just close the window; in the last case, the changes will be applied at the next start-up

🐛 In contradiction to the described behavior, after you select Not now and then close the Arduino IDE, the postponed update is installed immediately.

To reproduce

  1. In order to force an update offer, download an outdated nightly build, using the variant that supports auto-update for your OS.
    Latest outdated URLs at the time of writing are here:

    These download URLs can be derived from that of the current nightly by decrementing the date component.

  2. Install the downloaded application as usual

  3. Start the installed Arduino IDE.

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

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

  6. Change the "Arduino › Ide: Update Channel" (arduino.ide.updateChannel) setting to "nightly".

  7. Select File > Quit from the Arduino IDE menus.

  8. Start the installed Arduino IDE.

  9. Wait for the IDE to finish loading.

  10. Click the Download button on the "Update Available" dialog.

  11. Wait for the download to finish.

  12. Click the Not now button on the "Arduino IDE ___ has been downloaded." dialog.

  13. Select File > Quit from the Arduino IDE menus.

  14. Watch the Arduino IDE installation folder.

🐛 The IDE is updated immediately after exit, not on the next start-up.
The installation takes some time and there is no feedback to the user that an operation is in progress, so they might try to open the IDE again or shut down their machine during the installation.

Expected behavior

Postponed update behavior matches described behavior: update occurs on the next start-up.

Arduino IDE version

Original report

2.0.0-rc4-snapshot-354b74c

Last verified with

9a6a457

Operating system

  • Windows

Operating system version

  • Windows 10
  • Windows 11

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Feb 28, 2022
@AlbyIanna
Copy link
Contributor

I see. This could be an issue when the user tries to open/modify the IDE when the installation is in progress. I'm not sure if/how we can leverage electron-updater to postpone the installation until the next start-up.
I don't think this is very common to happen, so maybe we "fix" this temporarily by changing the copy to make it more clear that the installation is going to happen when the IDE is closed and not on the next start-up. @per1234 what do you think of it?

@per1234
Copy link
Contributor Author

per1234 commented Mar 2, 2022

I think the best fix is to always run the interactive installer. This will clearly communicate to the user what is happening and also give them the option to cancel the process.

With that change, I don't think any adjustments to the dialog text are needed.

I found it odd that I got a different installation behavior from clicking the Close and Install button than I did from clicking the Not now button and then closing the IDE.

@AlbyIanna
Copy link
Contributor

Well, actually they're not different behaviours. Once the update is downloaded, the installation will always take place when the IDE is closed. I think it's not a good idea to quit the IDE automatically immediately after the download finishes, we must warn the user before taking such an action.
@ubidefeo do you have an opinion on this?

@per1234
Copy link
Contributor Author

per1234 commented Mar 2, 2022

they're not different behaviour

They are different behaviors. With one you get an interactive installation. With the other you get a silent installation.

Close and Install

  1. Click the Close and Install button on the "Arduino IDE ___ has been downloaded." dialog.

The IDE closes and you get the interactive NSIS installation for the update:

close-and-install

Not now

  1. Click the Not now button on the "Arduino IDE ___ has been downloaded." dialog.
  2. Select File > Quit from the Arduino IDE menus.

The IDE is updated silently:

not-now

@per1234
Copy link
Contributor Author

per1234 commented Mar 2, 2022

I think it's not a good idea to quit the IDE automatically immediately after the download finishes, we must warn the user before taking such an action.

Of course.

I think I did not explain my proposal clearly enough.

Here is the current behavior:

  1. Click the Not now button on the "Arduino IDE ___ has been downloaded." dialog.
  2. Select File > Quit from the Arduino IDE menus.
  3. The IDE is updated silently.

Here is the behavior I am proposing:

  1. Click the Not now button on the "Arduino IDE ___ has been downloaded." dialog.
  2. Select File > Quit from the Arduino IDE menus.
  3. The IDE is updated interactively.

@AlbyIanna
Copy link
Contributor

Oh, sorry! I didn't get it at all.
On MacOS (and I think on Linux too) you don't get any interactive installation, even when you click Close and Install.

So, as far as I understand, this is an issue on Windows only. @per1234 is it right?

@per1234
Copy link
Contributor Author

per1234 commented Mar 2, 2022

I think on Linux too

That is correct.

this is an issue on Windows only.

Well, the Linux behavior also does not match what was described ("the changes will be applied at the next start-up"). However, the install on close is not a problem because it is only a replacement of a single file and happens almost instantly even when I tried it on a slow old laptop.

The update takes a significant amount of time on Windows and is not atomic. So this is where the silent update caught me by surprise.

@per1234
Copy link
Contributor Author

per1234 commented Mar 9, 2022

I just got an update in VS Code and thought it would be interesting to see how they handle this "postponed update" condition:

  1. Accept the update download by clicking the Install Update button on the update offer notification:
    image
  2. Wait for the download to finish.
  3. Postpone the installation by clicking the Later button on the "Restart Visual Studio Code to apply the latest update." notification:
    image
  4. Select File > Exit from the VS Code menus to exit all windows.

The installation occurs immediately. The process is communicated to the user by displaying a progress indicator until it is completed:

image

@AlbyIanna
Copy link
Contributor

Nice one @per1234! I tried getting a grasp on how vscode does automatic updates, but it's quite complex. I'll definitely get back to it when I'll have more time for this issue.

For reference: updateService.win32.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants