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] Add retry for auto updates #1217

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

flavioislima
Copy link
Contributor

@flavioislima flavioislima commented Jan 22, 2025

This pull request includes changes to improve the robustness of the update process in the src/backend/updater.ts file. The most important changes introduce a retry mechanism for update attempts and enhance the logging and tracking of update errors.

Improvements to update process:

  • Added updateAttempts and MAX_UPDATE_ATTEMPTS variables to manage the number of update retries.
  • Implemented a retry mechanism in the autoUpdater.on('error', async (error) => { event handler to retry updates up to three times with a 5-second delay between attempts.
  • Enhanced the tracking of update errors by including the total number of attempts in the event properties and resetting the updateAttempts counter after all attempts fail.

HOW TO TEST

  • On Windows, after installing the artifact and launching it
  • It will start the update, disconnect from internet or cause anything to cut the connection.
  • In the logs it should show something like: Retrying update attempt...

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)

@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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

6 participants