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

Use skipWaiting() in the Electron app to ensure immediate update after upgrade install #558

Open
Jaifroid opened this issue Feb 2, 2024 · 1 comment

Comments

@Jaifroid
Copy link
Member

Jaifroid commented Feb 2, 2024

The Electron app's upgrade process may be a bit confusing for users. With the exe and AppImage versions, it will download updated code in the background while the user is using the app (if they allowed auto-update), and then offer the update, asking users to restart. However, due to the change in architecture whereby the app runs as a (fully local) PWA under the hood, it isn't fully updated after the restart. It will need a FURTHER restart for the PWA to update itself from the new code.

There is a way to upgrade a PWA immediately, using skipWaiting(). However, that is not a good experience for standard PWA users because it makes upgrades more intrusive (they can interrupt the browsing session). So we need to be able to detect the situation, which is a bit tricky, but probably achievable.

@Jaifroid
Copy link
Member Author

I've investigated this a bit, but calling skipWaiting() on its own once the Cache Promises have completed doesn't do the job. It's possible that combining this with an auto-refresh (reload) might work, but it would be important to ensure that it is not obvious or disruptive to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant