NSMetadataUbiquitousItemPercentDownloadedKey doesn't update with intermediate values

Originator:aditya
Number:rdar://33179618 Date Originated:07-Jul-2017 05:34 pm
Status:Open Resolved:
Product:iCloud Product Version:10.x
Classification:Security Reproducible:Always
 
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

Actual 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.x

Notes:

Comments

Apple Developer Relations

Engineering has requested the following information in order to further investigate this issue:

Please collect iCloud Drive logs and attach them to your bug report. Important: Note the date and time issue occurred and add this information to the bug report.

iOS iCloud Drive Logging Instructions: https://developer.apple.com/services-account/download?path=/iOS/iOS_Logs/iCloud_Drive_Logging_Instructions.pdf

iOS iCloud Drive Logging Profile: https://developer.apple.com/services-account/download?path=/iOS/iOS_Logs/iCloudDrive.mobileconfig

macOS iCloud Drive Logging Instructions: https://developer.apple.com/services-account/download?path=/OS_X/OS_X_Logs/iCloud_Drive_Logging_Instructions.pdf

macOS iCloud Drive Logging Profile: https://developer.apple.com/services-account/download?path=/OS_X/OS_X_Logs/iCloudDrive.mobileconfig


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!