Fix progress bars not clearing on completion after React 19 upgrade#7062
Open
nickwesselman wants to merge 2 commits intomainfrom
Open
Fix progress bars not clearing on completion after React 19 upgrade#7062nickwesselman wants to merge 2 commits intomainfrom
nickwesselman wants to merge 2 commits intomainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
The Ink 6 / React 19 upgrade (269f3aa) deferred unmountInk() in ConcurrentOutput to let React 19 flush batched state updates, but missed the same pattern in useAsyncAndUnmount (used by Tasks) and SingleTask. Without the deferral, unmountInk() fires before the setState that triggers `return null` is flushed, so the final render still contains the LoadingBar and it is never erased. Wrap unmountInk() in setImmediate() in both places, matching the existing fix in ConcurrentOutput. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
465d331 to
55dbfc8
Compare
ryancbahan
approved these changes
Mar 20, 2026
Contributor
ryancbahan
left a comment
There was a problem hiding this comment.
Let a note in Slack -- we should merge to fix regression, since this matches code we shipped elsewhere. but this manual management of Node event loop within a React side effect to handle mounting/unmounting feels...very cursed. I'd like us to come back to this.
3 tasks
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
269f3aa6) deferredunmountInk()inConcurrentOutputwithsetImmediate()to let React 19 flush batched state updates, but missed the same pattern inuseAsyncAndUnmount(used byTasks) andSingleTaskunmountInk()fires before thesetStatethat triggersreturn nullis flushed, so the final render still contains theLoadingBarand it is never erased from the terminalunmountInk()insetImmediate()in both places, matching the existing fix inConcurrentOutputRepro:
shopify kitchen-sink async— progress bars remain on screen after completing.See the equivalent change in
ConcurrentOutput.tsxfrom #6831 (269f3aa6).Test plan
Tasks.test.tsx— 13 tests passSingleTask.test.tsx— 11 tests passshopify kitchen-sink asyncand verify progress bars clear on completion🤖 Generated with Claude Code