watchOS 5 beta 4: WKIntentDidRunRefreshBackgroundTask not triggered on a Siri voice shortcut

Originator:uberjason
Number:rdar://42394105 Date Originated:19-Jul-2018 03:09 PM
Status:Open Resolved:
Product:watchOS + SDK Product Version:5.0
Classification:UI/Usability Reproducible:Always
 
Summary:
Sample project here: https://github.com/UberJason/ShortcutsWatchOSBugs

In watchOS 5, a new background refresh task (WKIntentDidRunRefreshBackgroundTask) was introduced to run after an Intent extension is executed, since the Intent extension is a separate process. 

This refresh task is triggered correctly when running an Intent-based shortcut triggered by tapping a platter from the Siri watch face. However, the refresh task is NOT triggered when running an Intent-based shortcut using a Siri shortcut phrase.

Steps to Reproduce:
Run the sample project listed above, and follow the instructions in the README or in the iOS app screen. Reproduced for convenience here:
- In iOS Settings.app, ensure developer settings for shortcuts testing are set ("Display Recent Shortcuts" and "Display Donations on Lock Screen").
- Run the iOS app once, which triggers a donation and shows the shortcut on Spotlight.
- Run the watchOS app once, which sets a relevant shortcut and shows the shortcut on Siri Watch Face.
- In iOS Settings.app > Siri, create a voice shortcut for the "Do A foo" shortcut. The voice shortcut may be something like "Do It".
- Debug the watchOS app, which attaches the debugger to the WatchKit Extension.
- Go back to the Siri Watch Face, and invoke the shortcut, bringing up the confirmation dialog, and tap "Do".
- Notice that the debugger prints "Intent did run" from the WatchKit Extension.
- Invoke Siri by holding the digital crown, and then speak the voice shortcut (e.g. "Do It").
- Notice that the debugger does NOT print "Intent did run" from the WatchKit Extension.

Note that the intent extension *does* run successfully from a Siri voice shortcut. To verify this:
- Debug the watchOS shortcut in Xcode.
- Invoke Siri by holding the digital crown, and then speak the voice shortcut (e.g. "Do It").
- Notice that the debugger prints "Handled!", which is a print statement from the WatchIntentHandler.

Expected Results:
I expect the WKIntentDidRunRefreshBackgroundTask is triggered, as evidenced by the print statement "Intent did run". Also note, the Siri custom response does not display.

Actual Results:
The WKIntentDidRunRefreshBackgroundTask is not triggered, and the print statement is not printed.

Version:
5.0

Notes:

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!