Desktop - Add "Check For Update" system menu item#12607
Desktop - Add "Check For Update" system menu item#12607pecanoro merged 4 commits intoExpensify:mainfrom
Conversation
Obviously the texts here are a fruit of my imagination so we'll need to update them, |
|
I haven't provided screenshots for all platforms - I just verified they still run/build - as you can see nothing is changed for other platforms |
|
Looks good we're waiting for a copy! Screen.Recording.2022-11-11.at.7.45.07.AM.mov |
Santhosh-Sellavel
left a comment
There was a problem hiding this comment.
@kidroca Are we still waiting for copy here?
|
Note: there's a lot of code related to updates/auto-updates and creating menu items that can be extracted in separate files
|
Please take this idea to slack, if not already! |
|
In DEV update checks resolve with no update available (even when there's a new version):
DevTest.mov |
|
While building for production/staging, should I keep this file Should I add anything else? I can just clone your branch, and build desktop-staging should do right? |
It shouldn't matter, but just to be safe you can deleted it first
No
Yes |
|
@kidroca Not sure what I am doing wrong, app always crashes when I open the generated desktop build. I was unable to verify |
|
|
@Santhosh-Sellavel Could you check if this bug report and shared fix solves the crash for you: https://expensify.slack.com/archives/C01GTK53T8Q/p1667938306012479 |
|
Thanks, @kidroca It works! |
Screen recordingUpdate Available & unable to check errorScreen.Recording.2022-11-21.at.8.52.38.PM.movNo UpdateScreen.Recording.2022-11-21.at.9.20.13.PM.mov |
|
@kidroca Need some clarification Please check the above video for updates available flow
|
Could you kindly answer these questions:
If this bug report and the fix I shared here: #12607 (comment) resolved the build issue, could you post on the slack thread and move the bug report forward - I can commit the fix (from slack), but I think someone from the core team should confirm, so a separate PR might be better |
Yes
Where do you look for notifications? Unless:
It depends, it should work for QA with the staging app being built by Github Actions (I'll update Test/QA to mention testing this) The
I see the following error in the log: These items should be tested by QA as we can't simulate updates and applying updates locally |
|
Here's a video sample showing the system notification - because I'm in a Focus mode the notification does not appear, but I can see it in "Notifications" Desktop.-.Check.for.Updates.-.Made.with.Clipchamp.mp4I think since I have the App focused I should just see the in-app prompt that update is available, but that's another out of scope item |
|
@kidroca |
Reviewer Checklist
Screenshots/VideosOnly the desktop-specific code is modified here, so only the desktop screens are Added! DesktopUpdate Available & unable to check errorScreen.Recording.2022-11-21.at.8.52.38.PM.movNo UpdateScreen.Recording.2022-11-21.at.9.20.13.PM.mov |
Santhosh-Sellavel
left a comment
There was a problem hiding this comment.
Looks good tests well, all you @pecanoro!
|
@kidroca It seems the checks are failing on the PR author list, can ou double check nothing is missing from https://raw.githubusercontent.com/Expensify/App/main/.github/PULL_REQUEST_TEMPLATE.md? |
@pecanoro Just did and updated the PR with the new list of checks |
Co-authored-by: Rocio Perez <pecanoro@users.noreply.github.com>
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
@kidroca @luacmartins Can you pls help out with this PR internally as well. Recording.573.mp4 |
|
@mvtglobally this works for me! |
|
If there's no other way to test this right now - it can just be monitored over time
|
|
The production deploy comment failed for this PR, but this was deployed to production on v1.2.32-2 on Nov 28. |
@Santhosh-Sellavel You are already assigned, am I missing something? 😄 |
|
Rory Assigned me after I requested it here! |







Details
Add a "Check for Updates" system menu item
The "Check for Updates" appears until an update is downloaded (either manually or automatically), then it gets swapped by the "Update New Expensify" system menu item
Since the "Update available" notification is displayed only after an update is downloaded I've included a feedback dialog
The dialog is shown soon after clicking "Check for Updates" and the user is informed whether an update is available and being downloaded, or not update is available right now
Note: As other content (menu items) in
desktop/main.jsthe texts are not localized.Dialogs, notifications, menus localization is out current scope
Fixed Issues
$ #11817
PROPOSAL: N/A
Tests
To test in dev (temporarily) add the following file inside
./desktop/dev-app-update.ymlThis would allow the "Check For Update" menu item to work in dev (otherwise the
checkForUpdatesaction fails with an error)Testing on DEV
In DEV update checks resolve with no update available (even when there's a new version):
Testing building and running the staging/prod app
npm run desktop-buildornpm run desktop-build-stagingdesktop-build/NewExpensify.dmgto ApplicationsTo simulates that there are no updates available in staging or prod, go to main
package.jsonand set the app version, to the latest released version or newer.Now build the desktop app and launch it
Verify the "Check for updates" option appears in the system menu
Verify pressing it shows a dialog that there are no updates right now
Verify "Check for Updates" works offline
QA Steps
Preparation Steps
desktop-build/NewExpensify.dmgto ApplicationsVerify the new menu item exists
Verify "Check for Updates" informs us of a new version
I'm not sure whether it would be possible to test this in staging right away - if this (PR) is the latest version on Staging, checking for updates would, of course, respond that there are no new versions
I think in order to test you should save the
New Expensify.dmgsomewhere and install it (again) after a newer version is available on staging.Keep a
New Expensify.dmgso you can start over and test again in case you need to - installing an older version ofNew Expensifywould allow you to receive notifications that updates are availableFollow the Preparation Steps then
Verify applying the update works
After checking for updates and when update is available it would be downloaded automatically

When the download is over you should receive a notification like this
Clicking on the Notification should bring focus to App and prompt you to install the update now or skip

Verify "Check for Updates" informs us of that there's no newer version
This should be the case initially when this PR is the latest code on staging, or after installing an update
Follow the Preparation Steps then
Verify "Check for Updates" doesn't crash the app when used offline
Follow the Preparation Steps but stay offline
Verify the auto update check on startup still works
Follow the Preparation Steps but don't go offline at all
Verify the auto update check the runs every 8 hrs still works
Follow the *Preparation Steps and do stay offline
Launch the app, wait for several seconds and resume internet connectivity
There are 2 cases
PR Author Checklist
I linked the correct issue in the
### Fixed Issuessection aboveI wrote clear testing steps that cover the changes made in this PR
TestssectionOffline stepssectionQA stepssectionI included screenshots or videos for tests on all platforms
I ran the tests on all platforms & verified they passed on:
I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
I followed proper code patterns (see Reviewing the code)
toggleReportand notonIconClick)src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedIf a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
I followed the guidelines as stated in the Review Guidelines
I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like
Avatar, I verified the components usingAvatarare working as expected)I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
I verified that if a function's arguments changed that all usages have also been updated correctly
If a new component is created I verified that:
/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)If a new CSS style is added I verified that:
StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like
Avataris modified, I verified thatAvataris working as expected in all cases)If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.
PR Reviewer Checklist
The reviewer will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarhave been tested & I retested again)/** comment above it */thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)Screenshots
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
Screen.Recording.2022-11-09.at.19.37.18.mov
iOS
Android