Automatically update the Expensify.cash desktop app when a new version is released on mac
See original GitHub issueIf you haven’t already, check out our contributing guidelines for onboarding!
Platform - version:
- Platform: Chat desktop app
- Version: All versions (tested most recently on v1.0.1-271)
- This is applicable to Mac computers only
Action Performed (reproducible steps): Summary: the problem is that when an update is available for the desktop client, you have to manually close/reopen the desktop app for the update to take effect. This is true across all versions, and there are two potential methods to reproduce this:
Testing method - purposely install an older version of the Expensify.cash desktop app To reproduce this method, you can purposely install an older version of the desktop app. That way, there will always be an update available when you launch the app. To purposely install an older version for this method:
- Checkout an older git tag from the Expensify.Cash repo. You can see the full list of release tags here.
- Apply the diff outlined in the description of this PR
- Run
npm run desktop-build
. That will run a local production build and save the packaged result todist/Chat.dmg
- Use that
.dmg
file to install the desktop application. - When it launches, there will be an updated version available and you’ll see the desktop app does not automatically update by clicking
Expensify.cash
>About expensify.com
(Note: this can also be tested passively if you download the desktop app and wait a few hours, since we naturally release frequent version updates for the Expensify.cash)
Expected Result: Automatically update the Expensify.cash desktop app when an update is released, without requiring refresh or close/reopen.
Actual Result: When an update is released, the desktop app does not update automatically.
Notes/Photos/Videos: N/A
Logs - JS/Android/iOS (if applicable): N/A
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (14 by maintainers)
Top GitHub Comments
@michaelhaxhiu just wanted to check in on this!
So for a bit more context:
Right now we’re utilizing an
electron-updater
function calledautoUpdater.checkForUpdatesAndNotify
to update the desktop application, which:And as a note, we’re currently doing that when the app launches, then every hour after that.
What we could do instead is create some custom logic like so:
autoUpdater.checkForUpdates
autoUpdater.downloadUpdate
autoUpdater.quitAndInstall
autoUpdater.quitAndInstall
- that way the user potentially won’t even notice and the app will update like magic. I think this is our ideal scenario. This also mirrors how it happens on web, except on web we just refresh the page instead ofquitAndInstall
.