-
Notifications
You must be signed in to change notification settings - Fork 37
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] Improve and Fix Auto-Update on Windows and macOS #1217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Update attempts are always good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm on Mac!
4929a43
to
995f8d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…desktop-client into feat/retry_auto_update
…client into feat/retry_auto_update
…ndows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows
- After using the artifact I confirmed that after interrupting the update by disconnecting the internet it will have ten attempts and then give this error. Once the internet is restored it will attempt again after three hours and update as normal.
Mac
- After using the release draft created I confirmed that when the user selects YES to restarting after the update the client will relaunch with the update applied. If NO is selected then no update is applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. let's see if these retries help. the improved error messages will help with debugging too.
Tested on windows clicking no and also yes on the restart dialog. Worked fine both times.
import { trackEvent } from '../metrics/metrics' | ||
import { getErrorMessage, removeCachedUpdatesFolder } from './utils' | ||
// to test auto update on windows locally make sure you added the option verifyUpdateCodeSignature: false | ||
// under build.win in electron-builder.yml and also change the app version to an old one there | ||
|
||
const appSettings = configStore.get_nodefault('settings') | ||
const shouldCheckForUpdates = appSettings?.checkForUpdatesOnStartup === true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this app setting is false, HyperPlay will never update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will never check for updates on Startup. This is an old setting.
…desktop-client into feat/retry_auto_update
This pull request includes several changes aimed at improving the update process, error handling, and code organization. The most important changes include adding detailed error messages for update failures, renaming and restructuring files for better organization, and implementing a mechanism to retry updates and clear cached updates.
It should also fix all the false positives on the tracking mechanism that was sending error messages even if the app was on last version and not updating but only reaching the servers (more info on the ticket)
Improvements to error handling:
public/locales/en/translation.json
: Added detailed error messages for various update failure scenarios to provide better guidance to users.src/backend/updater/utils.ts
: Implemented a function to remove cached updates folder and defined common download errors with corresponding messages.Enhancements to update process:
src/backend/updater/updater.ts
: Introduced retry logic for update attempts, limited to a maximum of 10 retries, and added logging for each retry attempt. [1] [2] [3]Code organization and restructuring:
src/backend/updater/updater.ts
: Renamed and moved the file fromsrc/backend/updater.ts
tosrc/backend/updater/updater.ts
for better organization.src/backend/main.ts
: Updated import path forisClientUpdating
to reflect the new file structure.Configuration changes:
electron-builder.yml
: AddedverifyUpdateCodeSignature: false
under thewin
section to facilitate local testing of updates on Windows.HOW TO TEST
https://app.qase.io/project/HC?case=567&suite=175
https://app.qase.io/project/HC?case=568&suite=175
https://app.qase.io/project/HC?case=570&suite=175
Use the following Checklist if you have changed something on the Backend or Frontend: