mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
b592b1b051
The refactoring of `resource()` to use `linkedSignal()` introduced the potential for a race condition where resources would get stuck and not update in response to a request change. This occurred under a specific condition: 1. The request changes while the resource is still in loading state 2. The resource resolves the previous load before its `effect()` reacts to the request change. In practice, the window for this race is small, because the request change in (1) will schedule the effect in (2) immediately. However, it's easier to trigger this sequencing in tests, especially when one resource depends on the output of another. To fix the race condition, the resource impl is refactored to track the request in its state, and ignore resolved values or streams for stale requests. This refactoring actually makes the resource code simpler and easier to follow as well. Fixes #59842 PR Close #59851
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT