Fix rageshake upload progress bar

The Swift 6 migration consumed the KVO progress publisher through its AsyncSequence, which wants one value at a time. Progress updates that arrive while the loop is busy are dropped, the buffer holds onto the latest one until the loop is ready for it.

Signed-off-by: Daniel Anderson <daniel.anderson@toptal.com>
This commit is contained in:
Daniel Anderson
2026-07-30 00:14:17 -06:00
committed by Stefan Ceriu
parent 894b8edc2c
commit 06753c7748
@@ -296,7 +296,7 @@ nonisolated extension BugReportService: URLSessionTaskDelegate {
/// where the service lives.
func urlSession(_ session: URLSession, didCreateTask task: URLSessionTask) {
Task { @MainActor [weak self] in
for await value in task.progress.publisher(for: \.fractionCompleted).values {
for await value in task.progress.publisher(for: \.fractionCompleted).buffer(size: 1, prefetch: .byRequest, whenFull: .dropOldest).values {
self?.progressSubject.send(value)
}
}