Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Updating Atom takes more than one "Restart and Install..." click (macOS) #17976

Closed
1 task done
robertrossmann opened this issue Sep 4, 2018 · 4 comments · Fixed by #18775
Closed
1 task done

Updating Atom takes more than one "Restart and Install..." click (macOS) #17976

robertrossmann opened this issue Sep 4, 2018 · 4 comments · Fixed by #18775
Labels
auto-updater d ⬆️ i ⬇️ mac Issues that occur on macOS but not on other platforms. triaged v ⬆️

Comments

@robertrossmann
Copy link

Prerequisites

Description

When updating Atom with a project opened (see below for explanation), I have to click "Restart and install..." twice. The first time I click from the About package - this closes the Atom's window but keeps the application running. Then I have to click "Restart and install..." from the menubar to actually update Atom.

Steps to Reproduce

  1. Open Atom
  2. Wait for an update
  3. From the About package, click "Restart and install"
  4. Observe Atom window closing but Atom app still running in foreground
  5. From the menubar, click "Restart and install..." again
  6. Finally have Atom restart itself and install the update

Expected behavior: Clicking the button from the About package immediately restarts Atom and install the update.

Actual behavior: Clicking the button only closes Atom window but keeps the app running in foreground, forcing me to click the menubar's "Restart and install..." menubar item to actually update Atom

Reproduces how often: All the time for Atom, Atom Beta and Atom Nightly

Versions

Atom    : 1.32.0-nightly6
Electron: 2.0.7
Chrome  : 61.0.3163.100
Node    : 8.9.3

Additional Information

Only tested on macOS (High Sierra and Mojave).
This has been happening for several months now, I just did not find the time to report this. 😇

While there is only a single, empty (non-project) Atom window opened, the update procedure works as expected:

  1. Open fresh new Atom window only (tested from CLI via atom-nightly --new-window
  2. Wait for an update
  3. From the About package, click "Restart and install"
  4. Atom updates as expected

It looks like some project-related code path is keeping the Atom app from restarting itself correctly. 🤔

@rsese
Copy link
Contributor

rsese commented Sep 4, 2018

Thanks for the report @robertrossmann - since I started using the nightlies, I've noticed this too.

While there is only a single, empty (non-project) Atom window opened, the update procedure works as expected:

Similarly, if there are no windows open (but Atom is still running) updating works with a single Atom > Restart and install from the menubar.

@rsese rsese added mac Issues that occur on macOS but not on other platforms. triaged auto-updater labels Sep 4, 2018
@jsg2021
Copy link

jsg2021 commented Sep 28, 2018

This has hit everyone in my office using Atom. On every update. It has never worked as expected. I'm happy to provide any info if need be... just let me know what to gather.

@daviwil
Copy link
Contributor

daviwil commented Oct 26, 2018

Here are some notes from the investigation so far:

If you comment out this line, the "Restart and Install Update" action restarts Atom as expected but Atom's state is not reloaded correctly after the update is installed. The result is that it starts up an Atom window with no project loaded. Apparently the this.quitting = true line was added to fix this precise problem in #7234

With the this.quitting = true assignment in place, one thing you'll see in Atom's console log output is the following statement right before the update process stalls:

Sending message to WebContents with unknown ID 1

My suspicion here is that since the browser window is not prevented from being closed here (event.preventDefault() is not called in this event handler), the window closes before some future message passing occurs between the main process and renderer process, causing Atom's shutdown process to stall before the app fully shuts down. We may need to inherit some of the logic of the non-quitting code path so that the shutdown process can complete its operations and close cleanly.

@lock
Copy link

lock bot commented Aug 3, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-updater d ⬆️ i ⬇️ mac Issues that occur on macOS but not on other platforms. triaged v ⬆️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants