Skip to content

fix(distribution): stop the release spinner printing "null%" - #1100

Open
bhdnb wants to merge 2 commits into
mainfrom
distribution-null-progress-fix
Open

fix(distribution): stop the release spinner printing "null%"#1100
bhdnb wants to merge 2 commits into
mainfrom
distribution-null-progress-fix

Conversation

@bhdnb

@bhdnb bhdnb commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

crowdin distribution release <hash> printed a progress line reading Releasing distribution <hash>: null% on its way to a successful release.

The poll loop in DistributionService guarded the progress callback with release.progress !== undefined, but this endpoint sends progress: null while a release is pending. null !== undefined is true, so the null reached DistributionCommand's spinner message and rendered as the literal "null%".

Fixed in two places, not one. The guard becomes != null, and ReleaseStatus.progress is widened to number | null. With the old progress?: number, TypeScript sees number | undefined, which makes != null and !== undefined look equivalent -- the narrow type is what made the original guard look correct, and leaving it would invite the next reader to simplify the fix straight back out.

The three existing releaseDistribution tests all mocked progress as a number, which is why this survived. Added one that polls null -> null -> 40 -> success and requires the callback to receive [40]. Confirmed it has teeth: with the guard reverted it fails on [null, null, 40].

@bhdnb
bhdnb requested a review from andrii-bodnar September 2, 2026 09:56
@bhdnb bhdnb self-assigned this Sep 2, 2026
@bhdnb bhdnb added the bug label Sep 2, 2026
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.20%. Comparing base (aeb670b) to head (b95ffe4).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1100   +/-   ##
=======================================
  Coverage   92.20%   92.20%           
=======================================
  Files         141      141           
  Lines       11485    11485           
=======================================
  Hits        10589    10589           
  Misses        896      896           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread src-next/cli/services/DistributionService.ts Outdated
@bhdnb
bhdnb force-pushed the distribution-null-progress-fix branch from 9f1413b to ca3a54a Compare September 2, 2026 18:03
@bhdnb
bhdnb requested a review from andrii-bodnar September 2, 2026 18:04
@bhdnb

bhdnb commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Unrelated to this PR: the checkVersion test started failing unexpectedly. The fix is minimal, so I’ve included it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants