NSMetadataUbiquitousItemPercentDownloadedKey doesn't update with intermediate values

Originator:marcin.krzyzanowski
Number:rdar://33157157 Date Originated:06 Jul 2017
Status:Open Resolved:
Product:iCloud Product Version:10.x
Classification: Reproducible:
 
Area:
iCloud

Summary:
When checking NSMetadataUbiquitousItemPercentDownloadedKey attribute value,  it changes from 0 to 99.9 (or 100). No value in between. This kind of behavior makes the NSMetadataUbiquitousItemPercentDownloadedKey usless to follow the download progress.

It happens even though the NSMetadataQueryDidUpdateNotification is received in between. Not that NSMetadataQueryDidUpdateNotification is often received when the file is downloaded, yet I wanted to emphasize that.

Steps to Reproduce:
1. In the iCloud Drive container find the file that is not downloaded locally
2. Register observer for NSMetadataQueryDidUpdateNotification
3. Start downloading the file [fileManager startDownloadingUbiquitousItemAtURL:ubiquitousURL error:&error]
4. Check value of NSMetadataUbiquitousItemPercentDownloadedKey for the NSMetadataItem that represents the ubiquitousURL. e.g. [metadataItem valueForAttribute:NSMetadataUbiquitousItemPercentDownloadedKey];

Expected Results:
The value of NSMetadataUbiquitousItemPercentDownloadedKey increases from 0 to 100 incrementally e.g. with the values 0, 1, 4, 10, 13, 20, 50, 65, 70, 75, 81, 95, 100

Observed Results:
The value of NSMetadataUbiquitousItemPercentDownloadedKey starts with value 0, then changes to 100 when a file is downloaded, without any other value in the middle.

Version:
10.3.2

Comments

Engineering has determined that your bug report (33157157) is a duplicate of 33179618 (OPEN) and will be closed.

By marcin.krzyzanowski at July 18, 2017, 8:07 a.m. (reply...)

This happens for the items cached locally, yet the files are not marked as downloaded. Effectively the cached files are downloaded from the local cache to the local container, with the 2-3s (for 90MB file) delay reporting 0% at start, then 100% at the end.

By marcin.krzyzanowski at July 10, 2017, 7:09 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!