Skip to content

Fix _TOTAL_BAR regex pattern matching - #224

Merged
Wyze3306 merged 2 commits into
Wyze3306:mainfrom
Hultwl:Hultwl-Downloading-Percentage-Fix
Aug 24, 2026
Merged

Fix _TOTAL_BAR regex pattern matching#224
Wyze3306 merged 2 commits into
Wyze3306:mainfrom
Hultwl:Hultwl-Downloading-Percentage-Fix

Conversation

@Hultwl

@Hultwl Hultwl commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Problem
The launcher briefly prints an invalid download percentage before
settling into a normal 0-100% bar, then launches fine (#223).

Root cause
_TOTAL_BAR matched on the prefix of a progress bar's label
(^(initializing|downloading)), not the whole label. The real
aggregate bar's label is exactly "Downloading", but a per-file or
per-segment bar can be captioned "Downloading " — same prefix.
That segment's own tiny, near-complete total briefly gets read as the
whole package's total, so the percentage is computed against the
wrong denominator for one frame, until the next line (the real
aggregate bar) corrects it.

The Fix:
Anchor _TOTAL_BAR to the full label instead of a prefix match:

_TOTAL_BAR = re.compile(r"^(initializing|downloading)\s*$", re.I)

Testing

  • pytest tests/test_xodus.py — 83 passed
  • Added test_a_segment_bar_labelled_downloading_is_not_the_total_bar,
    which feeds _consume a "Downloading segment_0000.msixvc" line and
    asserts it's ignored, then confirms the real aggregate bar still
    drives progress correctly

Closes #223

@Wyze3306
Wyze3306 merged commit 4b3f7ff into Wyze3306:main Aug 24, 2026
7 checks passed
@Hultwl Hultwl mentioned this pull request Aug 24, 2026
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.

"Downloading Minecraft" Percentage is Off the Rails.

2 participants