Can no longer retrieve file promises for e-mail drag & drop pasteboard

Originator:aphofstede
Number:rdar://34605822 Date Originated:2018-01-04
Status:Open Resolved:
Product:Xcode Product Version:9.2 (9C40b)
Classification: Reproducible:Since macOS 10.12
 
Bug ID 36292515, marked as duplicate of 34605822.

Summary:
Since 10.12, the file promises from pasteboard API seems to have changed. It is no longer possible to get a file promise from an e-mail drag & drop operation, to read meta-data from.

Steps to Reproduce:
I used to be able to detect a dropped e-mail thread by calling draggingInfo.namesOfPromisedFilesDropped(atDestination: ...) and then pasteboard.string(forType: "com.apple.pasteboard.promised-file-url") would give me the projected file path. Now, this method no longer works and I cannot figure out how to get the file promises from a drag & drop operation from Mail.app. (I require a file reference to read mail-thread meta-data)

Expected Results:
The pasteboard offers some method of meta data

Actual Results:
Just a title is supplied

Version/Build:
Swift 3 / Swift 4
Xcode Version 9.2 (9C40b)
Since macOS 10.12

Configuration:
Here's my (verbose..) StackOverflow post https://stackoverflow.com/questions/47991603/receive-promised-e-mail-in-macos-10-12

Comments

Same issue

Just like the OP stackoverflow post, I also get Error: Error Domain=NSURLErrorDomain Code=-1001 "(null)". Same behavior described there.

Basically calling receivePromisedFiles with a block, file gets written instantly to destination url, but the reader block gets called after a minute or so all the time and sets this timeout error even tho the operation has succeeded.

Any idea why does this timeout? I have tried to disable sandbox aswell, different directories(NSTemporaryDirectory(), NSHomeDirectory(), NSHomeDirectory() + "mydirectory", etc... both with sandbox on and off and all the files entitlements). It does not make any difference whatsoever.

By eric.thockler at Oct. 22, 2019, 8:35 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!