Skip to content

Conversation

rickhanlonii
Copy link
Member

Overview

This test fails because an effect destroy function is called twice.

Note: the component that calls destroy twice is the top most Container component (with name="x")

The Scheduler log is:

      '[A:0]',
      '[B:0]',
      '[A:1]',
      '[B:0]',
      '[B:0]',
      '[B:1]',
      '[A:0]',
      '[B:0]',
      'Suspended! [[A:1]]',
      'Promise resolved [[A:1]]',
      'Promise resolved [[A:1]]',
      '[A:1]',
      '[B:0]',
      '[A:1]',
      '[B:0]',
      'Suspended! [[B:1]]',
      'Promise resolved [[B:1]]',
      'Promise resolved [[B:1]]',
      '[B:1]',
      '[A:1]',
      '[A:1]'

If it helps, I also added additional logging for the containers and effects:

'[A:0]',
      '[B:0]',
      'Text [A] mounted',
      'Text [B] mounted',
      'Remount children of Y after 0ms',
      'Remount children of X after 0ms',
      'Remount children of X after 0ms',
      '[A:1]',
      '[B:0]',
      'Text [B] unmounted',
      'Text [B] mounted',
      'Remount children of Y after 0ms',
      '[B:0]',
      'Text [B] unmounted',
      'Text [B] mounted',
      '[B:1]',
      '[A:0]',
      '[B:0]',
      'Text [A] mounted',
      'Text [B] mounted',
      'Remount children of Y after 0ms',
      'Remount children of X after 0ms',
      'Remount children of X after 0ms',
      'Suspended! [[A:1]]',
      'Promise resolved [[A:1]]',
      'Text [A] unmounted',
      'Text [B] unmounted',
      'Promise resolved [[A:1]]',
      '[A:1]',
      '[B:0]',
      'Text [A] mounted',
      'Text [B] mounted',
      'Remount children of Y after 0ms',
      'Remount children of X after 0ms',
      'Remount children of X after 0ms',
      '[A:1]',
      '[B:0]',
      'Text [B] unmounted',
      'Text [B] mounted',
      'Suspended! [[B:1]]',
      'Promise resolved [[B:1]]',
      'Text [A] unmounted',
      'Text [B] unmounted',
      'Promise resolved [[B:1]]',
      '[B:1]',
      'Text [A] mounted',
      'Text [B] mounted',
      'Remount children of Y after 0ms',
      'Remount children of X after 0ms',
      'Remount children of X after 0ms',
      '[A:1]',
      '[A:1]',
      'Text [A] unmounted',
      'Text [B] unmounted'

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 1, 2023
@kassens
Copy link
Member

kassens commented Apr 2, 2023

In this repro, only pushEffect() is called with the destroy function that's marked as "already called". I suspect this is an early indicator of incorrect behavior, but it doesn't actually call the second time safelyCallDestroy.

@rickhanlonii
Copy link
Member Author

Fixed by #26561

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants