WCSession doesn’t inform delegate of success/failure of file transfer with breakpoint on main queue
| Originator: | SirAnaxagoras | ||
| Number: | rdar://29779788 | Date Originated: | 12-21-2016 |
| Status: | Open | Resolved: | |
| Product: | watchOS SDK | Product Version: | watchOS 3.1 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: Using `transferFile:metadata:` on `WCSession` doesn’t provide the `session:didFinishFileTransfer:error:` callback and doesn’t update `outstandingFileTransfers` property even though the file is transferred to the counterpart iOS app when a breakpoint is applied in during the operation of sending the file. Attached screenshots show the out of sync data because there was no success/failure callback on the watchOS device. This causes extreme difficulty in debugging logic around WatchConnectivity transfers on watchOS. Sample project available [here](https://github.com/mattrobmattrob/WatchConnectivityTransferFileTest). Steps to Reproduce: 1. Open sample project and build `WatchConnectivity WatchApp` for simulator or device. 2. Open the Apple Watch app and the iOS app at the same time. 3. Tap the 1, 2, 3, and “All Files” buttons in any order or frequency. 4. See the watchOS and iOS labels updated as expected as files are sent between the devices based on the button presses. 5. Add a breakpoint at `InterfaceController.m::95` with `po self.session.outstandingFileTransfers.count` or something with a more complicated print out. 6. Tap the 1, 2, 3, and “All Files” buttons in any order or frequency. Expected Results: See the watchOS and iOS labels updated as expected as files are sent between the devices based on the button presses and confirmation is received from `WCSession`. Actual Results: iOS labels and watchOS’s attempted labels update as expected. The `session:didFinishFileTransfer:error:` is never received for some or all files. Version: Xcode Version 8.2 (8C38) Devices: iPhone 7, iOS 10.2 (14C92) Apple Watch Series 2, 38 mm, watchOS 3.1 (14S471) Simulators: iPhone 7 Plus Simulator, iOS 10.2 (14C89) Apple Watch Series 2 Simulator, 48 mm, watchOS 3.1 (14S471a) Notes: Configuration: Doesn't occur without a breakpoint set. Begins dropping delegate callbacks when breakpoint is set. Attachments: 'Simulator Screen Shot Dec 21, 2016, 4.13.06 PM.png', 'Simulator Screen Shot Dec 21, 2016, 4.13.05 PM.png' and 'WatchConnectivityBug.zip' were successfully uploaded.
Comments
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!