-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fix: Progress bar continue to update after footer #4084
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
Conversation
**Summary** Fixes #4023. There was nothing preventing the console reporter from having more than one progress bars, or keep updating and rendering its progress bar after it was finished or the reporter was "done". This patch stores the active progress bar, and stops it before `footer` is printed out. Also makes sure the progress bar itself ignores any updates once it stops. **Test plan** One, weak, existing test with updated snapshot. Manual steps: - Run `yarn install express` - Observe that your console is properly cleared after `yarn` finishes and the last thing you see is the "Done in X.YZs." message and not a corrupted progress bar.
chars: [string, string]; | ||
delay: number; | ||
id: ?number; | ||
_callback: ?Function; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you properly type this callback function?
if (!this.id) { | ||
clearTimeout(this.id); | ||
clearLine(this.stdout); | ||
this.id = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If !this.id
then the timeout is cleared?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope
…)" This reverts commit 280b6eb.
Summary
Fixes #4023. There was nothing preventing the console reporter from
having more than one progress bars, or keep updating and rendering
its progress bar after it was finished or the reporter was "done".
This patch stores the active progress bar, and stops it before
footer
is printed out. Also makes sure the progress bar itselfignores any updates once it stops.
Test plan
One, weak, existing test with updated snapshot. Manual steps:
yarn install express
yarn
finishes and the last thing you see is the "Done in X.YZs."
message and not a corrupted progress bar.