Include editor namespace in infinite-update-loop detector error#8612
Merged
Conversation
The circuit-breaker added in #8542 fires when update listeners endlessly re-enqueue updates (cascade count > 99). In production the resulting error is logged via editor._onError at the core boundary, so the stack is fully minified core frames -- there is no way to attribute the loop to a specific editor instance or plugin without a dev repro. Append the editor's namespace to the thrown error message via the existing invariant %s parameterization. editor._config.namespace is set distinctly per product/editor, so this partitions the aggregated error by tool with zero new logging surface and no behavior change. Extends the existing infinite-recursion test to assert the namespace appears in the error message.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
approved these changes
Jun 2, 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.
Description
The infinite-update-loop circuit-breaker added in #8542 fires when update listeners endlessly re-enqueue updates (
editor._cascadeCount > 99). It is working as intended, but its output is currently hard to act on.When the loop fires, the thrown error is surfaced via
editor._onErrorat the core boundary, so the aggregated stack is entirely minified core frames with an empty deferred stack. There is no way to attribute the loop to a specific editor instance or plugin without a dev repro — and the loop often only reproduces under specific product conditions.This appends the editor's namespace to the thrown error message using the existing
invariant(%s)parameterization:editor._config.namespaceis set distinctly per product/editor, so this immediately partitions the aggregated error by editor in error reporting — with zero new logging surface.Why this shape
_onErrorpath. Only the message string gains a%sarg.invariant(%s)pattern, so it slots into the error-code /codes.jsonminification cleanly.Test plan
Extended the existing
Detects infinite recursivity on update listenerstest inpackages/lexical/src/__tests__/unit/LexicalEditor.test.tsxto assert the thrown error message contains the editor's namespace, in addition to the existing/endlessly enqueueing/assertion.This PR was raised by Navi on behalf of Sherry Wong, at the request of the Lexical sync oncall.