question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Automatically update the Expensify.cash desktop app when a new version is released on mac

See original GitHub issue

If 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:

  1. Checkout an older git tag from the Expensify.Cash repo. You can see the full list of release tags here.
  2. Apply the diff outlined in the description of this PR
  3. Run npm run desktop-build. That will run a local production build and save the packaged result to dist/Chat.dmg
  4. Use that .dmg file to install the desktop application.
  5. 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:closed
  • Created 3 years ago
  • Comments:16 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
jbonifacecommented, Jan 8, 2021

@michaelhaxhiu just wanted to check in on this!

1reaction
roryabrahamcommented, Dec 23, 2020

So for a bit more context:

Right now we’re utilizing an electron-updater function called autoUpdater.checkForUpdatesAndNotify to update the desktop application, which:

  1. Checks for updates, and if one is available
  2. Downloads the update
  3. Once the download is finished, notifies the user that an update is available
  4. Then, the user must manually close & reopen chat for the update to be installed.

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:

  1. When the app launches, and every hour after that, check for updates using autoUpdater.checkForUpdates
  2. If an update is available, download the update using autoUpdater.downloadUpdate
  3. Once the download is finished, we can take more control:
    • Maybe once a week or so, or only for major updates, we can notify the user that an update is available by locally triggering a BrowserNotification. In the callback for that BrowserNotification, we can:
      1. Display a confirmation modal like: “Would you like to restart Expensify.Cash to install the latest updates?”, and once confirmed
      2. Restart the app with autoUpdater.quitAndInstall
      3. Note, this is basically how slack updates work
    • Alternatively, we can add listeners for if the window is minimized or closed (with the app still running), and if the app is backgrounded when an update is available, restart the app with 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 of quitAndInstall.
    • Some combination of the two options above???
Read more comments on GitHub >

github_iconTop Results From Across the Web

Use the App Store to update apps on Mac - Apple Support
In the App Store on your Mac, choose App Store > Settings. Select Automatic Updates.
Read more >
Expensify: Easy Money
Sign up or log in to automate your preaccounting process for expenses, bills, invoices, and more! Start a free trial and see why...
Read more >
Expensify/App - GitHub
Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by ...
Read more >
Expensify.cash for PC / Mac / Windows 7.8.10
App Details ; Size, Vwd ; Release Date, Mar 5, 2021 ; Category, Finance Apps ; Description: Expensify.cash is a reimagination of all...
Read more >
Expensify - Expense Reports - Apps on Google Play
Scan receipts, track business and personal expenses, and book travel all in one app. Download Expensify today and join millions of people worldwide...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found