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

Fix spawn forever #1708

Merged
merged 1 commit into from
Jan 3, 2024
Merged

Fix spawn forever #1708

merged 1 commit into from
Jan 3, 2024

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented Dec 11, 2023

Spawn forever currently removes the future that was spanned when the component is dropped. This changes spawn forever to not add the future to the list of futures that are removed when the component is removed.

Fixes this issue reported on discord:

I made a repo with a minimum reproducible example (https://github.com/lukasturcani/dioxus-future-issue) -- the long and short of it is that if I spawn a future with onclick my future reaches an await point but then never gets completed. 

I tried using both spawn and spawn_forever, as well as just returning the future from the onclick handler -- all lead to the same results. the interesting thing is -- this only happens if my onclick is nested inside a custom component. (the repo has both the working and non working code)

@ealmloff ealmloff added bug Something isn't working core relating to the core implementation of the virtualdom labels Dec 11, 2023
@ealmloff ealmloff merged commit 2e42443 into DioxusLabs:master Jan 3, 2024
10 checks passed
@ealmloff ealmloff deleted the fix-spawn-forever branch January 3, 2024 20:02
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.

1 participant