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

[FEAT] Improve and Fix Auto-Update on Windows and macOS #1217

Merged
merged 17 commits into from
Feb 27, 2025

Conversation

flavioislima
Copy link
Contributor

@flavioislima flavioislima commented Jan 22, 2025

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:

Enhancements to update process:

Code organization and restructuring:

Configuration changes:

  • electron-builder.yml: Added verifyUpdateCodeSignature: false under the win 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:

  • Tested the feature and it's working on a current and clean install.
  • Tested the main App features and they are still working on a current and clean install. (Login, Install, Play, Uninstall, Move games, etc.)
  • Created / Updated Tests (If necessary)
  • Created / Updated documentation (If necessary)

Sorry, something went wrong.

@flavioislima flavioislima added the PR: Ready-For-Review PR is ready to be reviewed by peers label Jan 22, 2025
@flavioislima flavioislima self-assigned this Jan 22, 2025
Copy link

@ry-animal ry-animal left a 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

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Contributor

@biliesilva biliesilva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm on Mac!

@flavioislima flavioislima added PR: Ready-For-Test PR is ready to be tested by a QA and removed PR: Ready-For-Review PR is ready to be reviewed by peers labels Jan 22, 2025
@flavioislima flavioislima force-pushed the feat/retry_auto_update branch from 4929a43 to 995f8d7 Compare January 22, 2025 21:19
Copy link

@nyghtstalker nyghtstalker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that I am getting an error popup and logs displaying "Retrying update attempt" after disconnecting the internet during the update.

image
image

@flavioislima flavioislima changed the title [FEAT] Add retry for auto updates [FEAT] Improve and Fix Auto-Update on Windows and macOS Feb 21, 2025
@flavioislima flavioislima added PR: Ready-For-Review PR is ready to be reviewed by peers and removed PR: Ready-For-Test PR is ready to be tested by a QA labels Feb 21, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@flavioislima flavioislima added PR: Ready-For-Test PR is ready to be tested by a QA and removed PR: Ready-For-Review PR is ready to be reviewed by peers labels Feb 24, 2025
Copy link

@nyghtstalker nyghtstalker left a 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.

image

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.

image
image

Copy link
Collaborator

@BrettCleary BrettCleary left a 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
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@flavioislima flavioislima merged commit 3bbff39 into main Feb 27, 2025
11 checks passed
@flavioislima flavioislima deleted the feat/retry_auto_update branch February 27, 2025 17:56
@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR: Ready-For-Test PR is ready to be tested by a QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants