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(ui): properly instantiates abort controllers #10309

Merged
merged 4 commits into from
Jan 2, 2025

Conversation

jacobsfletch
Copy link
Member

Fixes #10296. When an async useEffect runs twice or more before resolving, we use the Abort Controller API to cancel previous events. This works by instantiating a new ref on each run, and if a previous ref was detected, it will be aborted and a new instance will be set up for the next run. However, while the logic was aborting previous instances as expected, it was failing to instantiate a new one.

@jacobsfletch jacobsfletch merged commit abb51b9 into main Jan 2, 2025
68 checks passed
jacobsfletch added a commit that referenced this pull request Jan 2, 2025
Fixes #10296. When an async `useEffect` runs twice or more before
resolving, we use the Abort Controller API to cancel previous events.
This works by instantiating a new ref on each run, and if a previous ref
was detected, it will be aborted and a new instance will be set up for
the next run. However, while the logic was aborting previous instances
as expected, it was failing to instantiate a new one.
@jacobsfletch jacobsfletch deleted the fix/abort-controller branch January 2, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Getting "TypeError: Cannot read properties of undefined (reading 'signal')"
1 participant