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

feat: automatically restart to update #931

Merged
merged 3 commits into from
Aug 30, 2023
Merged

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Aug 25, 2023

When the Station is running in the tray, and a new version is detected, we immediately trigger "restart to install".

The goal is to speed up the adoption of new versions of Station Desktop.

Screenshot of the notification:

Screenshot 2023-08-25 at 15 28 15

How I tested the change:

  1. npm run package
  2. open dist/Filecoin\ Station.dmg
  3. Check that the new notification is shown
  4. Check that $HOME/Library/Logs/Filecoin Station/main.log contains the new message about restart:
    Restarting Station to install the new version
    

Unfortunately, the auto-update failed while verifying the code signature of the new version. I think this could be caused by running a locally-built Station and trying to update to one built by our CI.

When the Station is running in the tray, and a new version is detected,
we immediately trigger "restart to install".

The goal is to speed up the adoption of new versions of Station Desktop.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@juliangruber
Copy link
Member

Unfortunately, the auto-update failed while verifying the code signature of the new version. I think this could be caused by running a locally-built Station and trying to update to one built by our CI.

That's it. To test it properly we'd have to create a release. I think we can skip this for now

@bajtos
Copy link
Member Author

bajtos commented Aug 28, 2023

This change may introduce an endless loop if an update cannot be installed (e.g. because of filesystem permissions problems, as we experienced in the past.)

  • Station starts in the tray
  • We detect a new version and restart the app
    • This happens so quickly that the user cannot open the app window before we restart
  • Update is not installed
  • Application starts in the tray, quickly detects the new version and restarts again
  • and again
  • and again
  • ...

Possible solution:

  • Using electron-store, remember the last version we wanted to upgrade to
  • Don't restart automatically if the "new" version is the same as the one we tried to install last time

@juliangruber WDYT?

@juliangruber
Copy link
Member

Another option: Only try to update once the app has run for one minute. This should give the user enough time to break the cycle

@juliangruber
Copy link
Member

Otherwise I agree we need to track some state to prevent this loop

@bajtos
Copy link
Member Author

bajtos commented Aug 30, 2023

Added bdc462c to prevent infinite loop of app restarts.

@juliangruber PTAL

Copy link
Member

@juliangruber juliangruber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome! 👏

@bajtos bajtos enabled auto-merge (squash) August 30, 2023 09:15
@bajtos bajtos merged commit e4233ab into main Aug 30, 2023
10 checks passed
@bajtos bajtos deleted the feat-auto-restart-to-update branch August 30, 2023 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants