Skip to content

Fix installation/update progress reports to the frontend #2683

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

Merged
merged 1 commit into from
May 6, 2023

Conversation

arielj
Copy link
Collaborator

@arielj arielj commented May 6, 2023

This PR fixes a regression in 2.7.1 where the installation progress is not reported properly to the frontend.

Fixes #2680


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)

@arielj arielj requested review from a team, flavioislima, CommandMC, Nocccer and imLinguin and removed request for a team May 6, 2023 02:14
// parse log for percent
const percentMatch = data.match(/Progress: (\d+\.\d+) /m)
if (!progress.percent) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these checks were there in the original code, we need them to make sure we update only specific fields of the progress object

percent: undefined,
diskSpeed: undefined,
downSpeed: undefined
function defaultTmpProgress() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

these default object was inlined before and extracted here, but it needs to be inside a function so we always return a new object

the current code without a function passes the same object around and it's getting updated, it doesn't stay i this initial state

Copy link
Member

@flavioislima flavioislima left a comment

Choose a reason for hiding this comment

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

Tested here and the progress is working again.

@flavioislima flavioislima merged commit eb6f233 into main May 6, 2023
@flavioislima flavioislima deleted the fix-download-progress branch May 6, 2023 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download progress is not reported
2 participants