mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
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:
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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user