I've published a small standalone Swift package illustrating a search-state problem: an old request must not change results, errors or loading state after a newer query starts.
It combines task cancellation with a request revision and keeps selection by event identifier. The seven tests use controlled continuations, including a fetcher that deliberately ignores cancellation until the test resolves it. They cover stale success, stale failure, cleanup, an empty query, selection identity, a current error and cancelling during debounce.
This is an educational example prepared with coding-assistant support and tested with Swift 6.4 on macOS. It isn't extracted application code and doesn't include a SwiftUI observation adapter or live networking. I'd welcome feedback on the state contract and additional troublesome completion orderings worth testing.
Robin Winters