Severe bug: Modal Interface Controller hangs 100% of the time after waking from complication

Summary:

If you have an app with a modal interface controller visible, and you background the app, go to the clock face and reopen it, it will hang (no touch or scroll events), and will eventually either crash or dismiss the modal interface controller


Steps to Reproduce:

1. Launch sample app.

(Make sure to set a modular clock face with a modular large complication)

2. Present modal

3. Press the crown to go to the home screen.

4. Press the crown to go to modular clock face

5. Press the complication so the app opens


Expected Results:

The app is fully functional


Actual Results:

Can't scroll or tap.

Force touch seems to do something.


The app will eventually crash with this log


Jan 2 19:17:48 Marcs-AppleWatch BugKit WatchKit App[264] <Notice>: (Error) WatchKit: <SPApplicationDelegate.m __55-[SPApplicationDelegate _startActivatingAssertionTimer]_block_invoke:2067> We've held the CSLSActivatingUIAssertion for 30 secs. Giving up

Jan 2 19:17:48 Marcs-AppleWatch com.apple.xpc.launchd[1] (UIKitApplication:com.none.BugKit.watchkitapp[0x1bb9][264]) <Warning>: Service exited with abnormal code: 1


Version:

2.1 (13S661). Latest iOS 9.2 (13C75)

Accepted Reply

I think i got it !


Just implement handoff handler even you don't use it

and force reload root controller


-(void) handleUserActivity:(NSDictionary *)userInfo
{
     // userInfo : CLKLaunchedTimelineEntryDateKey => date entry 
    [WKInterfaceController reloadRootControllersWithNames:@[@"MyStartController"]
                                                 contexts:nil];
}


HTH

GB

Replies

Umm...yeah....forums posts don't count as bug reports, so as interesting and downright comprehensive as all that info is, thanks, you might want to avail yourself of the rather convenient Report Bugs link below right so as to make it official. As well (and if you've taken that step already) feel free to add your report # to your thread for reference and Happy New Year!


Ken

-=-

rdar://problem/24032476

I reported this same bug to Apple on mid-October via RADAR. It remained open until mid-December and was then closed as a "duplicate of bug 23922887". Hopefully they will fix it at some point.

Thank you

Hi,

It's a big problem.

I'll have to wait Apple fixes this bug before publishing my app.

Any workaround ? (without having to change modal to hierarchical)

Thanks

GB

I have not been able to find a workaround. I wouldn't wait on Apple to fix anything unless the workflow of your app is severely affected by this.


I suggest you file a duplicate RADAR or contact DTS to see what they have to say about this (probably that it is a bug and there isn't a workaround). I have a sample project if you need one.

The only thing i have found it's to dismiss automaticlly any modal Controller when extDelegate receive applicationWillResignActive


But it's a very bad solution :-/


GB

i just make tests, and the problem not seems appear if the modal controller is presented from a second controller in the hierarchy.


Ex: when app hangs and stop after 30s :

Run App
InterfaceController A
tap button to present modal controller M
back to main clock
tap complication
App activated with screen capture of last modal controller M but hangs and stop after 30s


Ex with a intermediate controller, no problem ?

Run App
InterfaceController B with only a button to push InterfaceController A
tap button
InterfaceController A is activated
tap button present modal controller M
back to clock
tap complication
App activated with InterfaceController B (screen capture of M appear quicly)


@San Marc : do you have the same result if you just insert a controller before ?


GB

I think i got it !


Just implement handoff handler even you don't use it

and force reload root controller


-(void) handleUserActivity:(NSDictionary *)userInfo
{
     // userInfo : CLKLaunchedTimelineEntryDateKey => date entry 
    [WKInterfaceController reloadRootControllersWithNames:@[@"MyStartController"]
                                                 contexts:nil];
}


HTH

GB

The reloadRootController workaround seems to work!. Especially if you handle state restoration well in your root controller.


I am not sure on how you would go to dismiss any modal controllers, as the controller stack inspection APIs of WatchKit are limited. Sending notifications would do it, but it's a more messy than just reloading the entire stack


I have not tried the second controller in stack fix, as it is not a workaround I am willing to implement. I can attach the sample project I sent Apple if you wish.


Have you tried this with the WatchOS 2.2 beta?

The default behavior without "handleUserActivity", is to reload the stack of controllers. When you tap on complication, the app seems to restart.

You can see this if you make an example with several controllers.

So, handleUserActivity and reloadRootControllers do the same thing. It's not really a workaround but you do it explicitly.


I found the solution when i had to send the complication entry to the 2d controller in the stack (the initial problem disappears).


I do not test WatchOS2.2 beta


GB


PS : dismiss any modal controller was just a test, forget it ;-)

(i test with sending notification)

This issue seems to be fixed with the WatchOS2.2 Update 🙂