-
-
Notifications
You must be signed in to change notification settings - Fork 333
Description
Summary
I'm reading an entry using a closure and the progress object that I pass to extract(_:bufferSize:skipCRC32:progress:consumer:) never gets to 100%. More precisely, the progress.fractionCompleted never gets to 1.
Steps to Reproduce
let progress = Progress()
archive.extract(entry, bufferSize: 1024, progress: progress) {
print("Completed: \(progress.fractionComplete)") // never gets to 1
}Expected Results
Maybe I’m misunderstanding how this is supposed to work, but I’d expect progress to reflect the total number of read bytes when the closure is called, so that during the last call progress.fractionCompleted is equal to 1.
Actual Results
It looks like progress.completedUnitCount is updated after calling the closure, not before. When the last chunk is passed to the closure, progress.completedUnitCount is still less than progress.totalUnitCount. Also, during the first closure call, progress.completedUnitCount is 0.
Regression & Version
ZipFoundation 0.9.20, Xcode 26.1.1, macOS 26.1