Skip to content

Commit 5656d09

Browse files
committed
Fix for #200
1 parent 7691fbf commit 5656d09

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 3.5.1
2+
3+
## Bugfix
4+
- Uploads that got cancelled by force closing an app didn't get retried on app launch (Issue: [#200](https://github.com/tus/TUSKit/issues/200))
5+
16
# 3.5.0
27

38
## Bugfix

Sources/TUSKit/TUSClient.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ public final class TUSClient {
117117
self.scheduler = scheduler
118118
self.reportingQueue = reportingQueue
119119
scheduler.delegate = self
120+
removeFinishedUploads()
121+
reregisterCallbacks()
120122
}
121123

122124
/// Initialize a TUSClient
@@ -475,7 +477,11 @@ public final class TUSClient {
475477
}
476478

477479
self.api.registerCallback({ result in
478-
task.taskCompleted(result: result, completed: { _ in })
480+
task.taskCompleted(result: result, completed: { [weak self] result in
481+
if case .failure = result {
482+
try? self?.retry(id: metadata.id)
483+
}
484+
})
479485
}, forMetadata: metadata)
480486
}
481487
}

0 commit comments

Comments
 (0)