[Reconciler] Fix: "Should not already be working" in Firefox after a breakpoint/alert #17355#36403
[Reconciler] Fix: "Should not already be working" in Firefox after a breakpoint/alert #17355#36403prashant3030223 wants to merge 1 commit intofacebook:mainfrom
Conversation
|
Hi @prashant3030223! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Hey thats not how this works I'm just in one of my old phones that holds
these accounts. Please be nice
…On Sun, May 3, 2026 at 2:00 AM Prashant Yadav ***@***.***> wrote:
Summary
This PR addresses the "Should not already be working" invariant error that
occurs in Firefox when an alert() or debugger breakpoint is triggered. In
these scenarios, the browser flushes the task queue while a React
render/commit is already in progress. By adding getExecutionContext()
guards to the scheduler's entry points, we ensure that re-entrant work is
correctly deferred until the current work loop completes.
Fixes #17355 <#17355>
How did you test this change?
I verified the change by analyzing the execution context flow and ensuring
the guards correctly identify the RenderContext and CommitContext during
re-entrant calls. This pattern is consistent with existing fixes for
Safari's microtask flushing behavior in ReactFiberRootScheduler.js.
I also manually verified that the getExecutionContext() bitmask correctly
identifies active work phases, preventing the performWorkOnRoot from
throwing when called re-entrantly.
------------------------------
You can view, comment on, or merge this pull request online at:
#36403
Commit Summary
- 88e0849
<88e0849>
Fix: avoid re-entrant work during render or commit
File Changes
(1 file <https://github.com/facebook/react/pull/36403/files>)
- *M* packages/react-reconciler/src/ReactFiberRootScheduler.js
<https://github.com/facebook/react/pull/36403/files#diff-b3d2d7db3b8f8517d9b1868d74049fadd238467c0a85f7f28d81a85db1f587da>
(12)
Patch Links:
- https://github.com/facebook/react/pull/36403.patch
- https://github.com/facebook/react/pull/36403.diff
—
Reply to this email directly, view it on GitHub
<#36403>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BZ75UJ2WBM4SU324XAYV3IL4Y4DDLAVCNFSM6AAAAACYO4KXH6VHI2DSMVQWIX3LMV43ASLTON2WKOZUGM3TCMZSGU2DEMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Summary
This PR addresses the "Should not already be working" invariant error that occurs in Firefox when an alert() or debugger breakpoint is triggered. In these scenarios, the browser flushes the task queue while a React render/commit is already in progress. By adding getExecutionContext() guards to the scheduler's entry points, we ensure that re-entrant work is correctly deferred until the current work loop completes.
Fixes #17355
How did you test this change?
I verified the change by analyzing the execution context flow and ensuring the guards correctly identify the RenderContext and CommitContext during re-entrant calls. This pattern is consistent with existing fixes for Safari's microtask flushing behavior in ReactFiberRootScheduler.js.
I also manually verified that the getExecutionContext() bitmask correctly identifies active work phases, preventing the performWorkOnRoot from throwing when called re-entrantly.