mirror of
https://github.com/apple/swift-async-algorithms
synced 2026-11-25 04:27:48 +00:00
Preserve debounce upstream failure without outstanding demand (#451)
* Preserve debounce upstream failure without demand * Add debounce upstream failure regression tests
This commit is contained in:
1 parent
d9c26817af
commit
cbde9aed74
2 files changed
+73
-3
No files matched your search
@@ -399,9 +399,9 @@ struct DebounceStateMachine<Base: AsyncSequence & Sendable, C: Clock>: Sendable
|
||||
return .none
|
||||
|
||||
case .waitingForDemand(let task, .none, let clockContinuation, .none):
|
||||
// We don't have any buffered element so we can just go ahead
|
||||
// and transition to finished and cancel everything
|
||||
self.state = .finished
|
||||
// We don't have outstanding demand to deliver the error to, so store it
|
||||
// until the downstream calls next and cancel everything.
|
||||
self.state = .upstreamFailure(error: error)
|
||||
|
||||
return .cancelTaskAndClockContinuation(
|
||||
task: task,
|
||||
|
||||
Reference in new issue
Block a user