Skip to content

Heroic update progress bar shows incorrect percentage which doesnt match with legendary's percentage #4190

Open
@RoguedBear

Description

@RoguedBear

Describe the bug

I was updating fortnite and noticed that the progress bar was stuck at 90% since half hour.

I went ahead and inspected the legendary logs and found the percentage to be vastly different from the one shown in ui. (this is shown in my screenshot down below where i paused the update and screenshotted the last entry which corresponds with what is displayed in the ui)

I tried to look into why this could be when other metrics are exactly the same as displayed in logs but different for percentage and found this snippet in the following file:

// calculate percentage
if (progress.bytes !== '') {
const downloaded = parseFloat(progress.bytes)
const downloadCache = totalDownloadSize - currentDownloadSize[appName]
const totalDownloaded = downloaded + downloadCache
const newPercent =
Math.round((totalDownloaded / totalDownloadSize) * 10000) / 100
progress.percent = newPercent >= 0 ? newPercent : undefined
}

this is in function onInstallOrUpdateOutput, and from what it appears looking through rest of the code, we are parsing all other metrics such as download speed, eta, disk write speed, downloaded bytes, etc, directly from the logs, but for percentage for some reason it is being calculated in the code only.

I am not sure what is wrong with the calculation here, but I do think if we are parsing all other metrics from legendary itself, we should also parse the progress from the log rather than calculating ourselves as the legendary binary would have a better context and calculation for the correct progress, reducing the effort done on heroic side.

Add logs

< logs added as attachment as there are more than 2k lines and 12k lines for heroic & legendary respectively >

Steps to reproduce

  1. put a game on update
  2. the progress starts from ~80% (see logs)
  3. compare with legendary logs
  4. you will see a mismatch between progress reported by heroic & legendary, with legendary one being more correct

Expected behavior

the percentage value should match exactly what is outputted from legendary

Screenshots

image_2024-12-21_02-14-52

Heroic Version

Latest Stable

System Information

System Information:
CPU: 12x 13th Gen Intel(R) Core(TM) i5-13420H
Memory: 16.89 GB (used: 8.61 GB)
GPUs:
  GPU 0:
    Name: Intel Corporation Raptor Lake-P [UHD Graphics]
    IDs: D=a7a8 V=8086 SD=3c90 SV=17aa
    Driver: 31.0.101.4255
OS: Microsoft Windows 11 Home Single Language 10.0.22631 (win32)

The current system is not a Steam Deck
We are not running inside a Flatpak container

Software Versions:
  Heroic: 2.15.2 Emeth
  Legendary: 0.20.34 Direct Intervention
  gogdl: 1.1.2
  comet: comet 0.1.2

  Nile: 1.1.2 Will A. Zeppeli

Additional information

log files which corroborate the same:
2024-12-20T19_41_48-heroic.log

2024-12-20T19_41_48-legendary.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug:unconfirmedSomeone works on identifying the issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions