Repository navigation
fix(core): cancel obsolete resource loads when params become unavailable - #71766
Merged
thePunderWoman merged 1 commit intoNov 11, 2026
Conversation
Cancel previous loads before returning for unavailable or errored resource params. These transitions otherwise leave the old AbortSignal active and keep its pending task blocking application stability. Preserve pending-task ownership when cancelled promises settle after a new request starts. Cover unavailable params, propagated statuses and errors, and late resolution or rejection in regression tests.
JeanMeche
approved these changes
Nov 10, 2026
Contributor
|
This PR was merged into the repository. The changes were merged into the following branches:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
PR Type
What is the current behavior?
When params return
undefined, propagateResourceParamsStatus.IDLE/LOADING, or throw an error during a pending load,loadEffect()returns before cancelling the obsolete loader. The resource changes status, but the old AbortSignal stays active and its pending task can block application stability indefinitely.Fixes #71765.
What is the new behavior?
Cancel the previous load before checking whether the new request can run. Unavailable params now abort obsolete work and release its pending task, including when the old loader never settles.
Add six regressions covering undefined params, propagated statuses/errors, recovery, and late resolution/rejection after a new load starts. The latter checks that old completions neither replace the new state nor release the new load's pending task.
Does this PR introduce a breaking change?
Other information
Validation:
pnpm bazel test //packages/core/test/resource:resource— all 76 specs pass. With the original implementation, the new stability regressions time out.pnpm lint— passes, including formatting checks.pnpm bazel test //packages/...— 792 of 796 test targets pass. The four failures also reproduce with the original implementation: the two common browser suites have timezone-dependent DatePipe/formatDate expectations;perform_compilefails its inherited compiler-options cache invalidation test; Firefox WebMCP depends on suite order because onlyprovide_tools_spec.tsoverridesoriginAgentCluster. The Firefox failure reproduces on the original source withJASMINE_RANDOM_SEED=71267.