Then
Then copied to clipboard
Progress not getting called
Hi, struggling with the semantics for progress block
Here are two scenarios:
getFile()
.then(uploadFile)
.progress {
/// Not getting called
}
getFile()
.then {
self.uploadFile(fileUrl: $0)
.progress {
/// Called OK
}
}
Is this the expected behavior? Or am I doing something wrong in the first case?
Thanks
@alexandre-g it seems like the first case shouldn't compile if uploadFile
has a named argument.
What happens if you run this:
getFile()
.then(self.uploadFile(fileUrl:))
.progress {
// is it called?
}
@NunoAlexandre Sorry for taking a while to test.
It does compile - from what I've seen it only complains if argument number/type does not match.
I've tried the formatting you suggested and still the same issue. You can test by slightly modifying the testProgress()
test by making a version of upload() that takes an argument and trying to call
doSomething()
.then(upload(url:))
.progress { p in
// not getting called
}.then {
// gets called
}
@alexandre-g this does look like a bug indeed. Could you share the full code involved (if possible) so we can try and debug it ?
@NunoAlexandre Thanks for chiming in 👍
PS: Please excuse the late reply 🙏
I'm experiencing the same behavior. Any update on this? Thanks for looking into it.
+1
🙏
No luck on this? I'm facing the same issue.
Nope. I already moved away from the lib.