Skip to content

fix(hot): name an un-awaited act() as the cause of an open act scope - #813

Draft
danfry1 wants to merge 1 commit into
mainfrom
fix/hot-unawaited-act-cause
Draft

danfry1 wants to merge 1 commit into
mainfrom
fix/hot-unawaited-act-cause

Conversation

@danfry1

@danfry1 danfry1 commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Summary

With one worker under hotRuntime, files that inherit an open act() scope now say when the cause is an act() call that was not awaited, instead of describing every open scope as a likely timeout.

Why

An un-awaited async act() never closes React's scope. The HOT_RESIDENT_UNUSABLE message blamed a timeout, which sent users looking for the wrong bug.

Changes

  • The hot runner notes whether a test in the leaving file failed while the scope was open. If none did, the message names an act() call in that file that was not awaited and says to await it. Otherwise it keeps the timeout wording.
  • test:native:hot:act-scope adds a one-worker un-awaited case. Both one-worker cases now check which cause they name.
  • errors.md and the troubleshooting Known differences entry describe both causes.

Notes

  • The wait for the scope to close is unchanged. Whether an act() result was awaited is private to React, so a scope that will never close can't be told apart from one still waiting on its callback without wrapping act().
  • Target: 0.16.0.

Fixes #812

With one worker, files that inherit an open act() scope now name an
act() call that was not awaited when no test in the leaving file failed
while the scope was open, instead of describing it as a likely timeout.
@danfry1 danfry1 added this to the 0.16.0 milestone Nov 14, 2026

This branch has not been deployed

No deployments
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.

Hot runtime: an un-awaited async act() never closes; the one-worker check waits for it anyway and names the wrong cause

1 participant