Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't run effects from dead recycled scopes #3201

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented Nov 12, 2024

Fixes #3196 by removing effects queued for the scope as the scope itself is removed

@ealmloff ealmloff added bug Something isn't working core relating to the core implementation of the virtualdom labels Nov 12, 2024
@rogusdev
Copy link
Contributor

rogusdev commented Nov 12, 2024

Thanks for jumping on this! However, while these changes do stop the panic from the issue from happening, yes, but 2 things: 1. now it does not actually give the correct behavior with the expanded children when clicking between items and 2. the debug warnings are still present (or do you think those are from something else?)

@ealmloff
Copy link
Member Author

ealmloff commented Nov 12, 2024

Thanks for jumping on this! However, while these changes do stop the panic from the issue from happening, yes, but 2 things: 1. now it does not actually give the correct behavior with the expanded children when clicking between items and 2. the debug warnings are still present (or do you think those are from something else?)

One of the changes I made was causing tasks to be dropped without being polled (which was also causing tests to fail). That should be fixed now and your reproduction code works in debug and release. The warning should be fixed by #3194

@rogusdev
Copy link
Contributor

Thanks can also confirm that it all now works. :)

Why was the warning happening in debug but not release, and the panic happening in release but not debug?

@ealmloff
Copy link
Member Author

Why was the warning happening in debug but not release, and the panic happening in release but not debug?

We do extra checks when debug assertions are enabled including that warning. I'm not exactly sure why the panic was only happening in release mode, but it was caused by id allocation which could change based on the number of scopes or the order scopes are diffed in

@jkelleyrtp jkelleyrtp merged commit 128608f into DioxusLabs:main Nov 13, 2024
17 checks passed
@ealmloff ealmloff deleted the don't-run-dead-effects branch November 13, 2024 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core relating to the core implementation of the virtualdom
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic / warnings from use_effect on ReadOnlySignal ?
3 participants