Skip to content

[BUG] addChild can create self‑referential _prevRep / _nextRep when re‑adding an already‑linked tween #1138

Description

@justinbelcher

Describe the bug

We hit a tab freeze where a tween’s _prevRep points to itself, causing an infinite loop during update traversal. This was caused by a race condition in our app that started overlapping “replace” tweens on the same target/property. But it seems like the engine should be robust to re‑adding an already‑linked node so we're reporting.

Observed state in devtools:

// same ID repeating thousands of times
{ id: 5184, _prevRep: { id: 5184, ... } }`
Image

Expected behavior

addChild should guard against re‑adding a node already linked in the list. Relevant call site

Provide a minimal reproduction demo of the bug

Inherently difficult, as this was caused by a bug in our own code that presented intermittently. It had to do with the interplay of animation promise landing, document.hidden foregrounding, and some state being tied to React render cycle. We fully acknowledge that part and just wanted to surface the edge case.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions