mParticle / mparticle-apple-sdk

mParticle Apple SDK
Apache License 2.0
45 stars 66 forks source link

MPAppDelegateProxy crashing on iPad for users who's using physical keyboard #285

Open iMostfa opened 1 month ago

iMostfa commented 1 month ago

Hello Team, we have seen the attached crash stack coming from a lot of iPad users.

we are able to reproduce the issue on simulator.

you can reproduce it by: running an application on iPad, try to navigate to a textField using tab button using the physical keyboard, then it will crash.

turnning off appDelegate Proxying, solves the issue, still, we don't want to turn it off, as we think that the issue could be solved from your side.

OS Version: iOS 18.1 (22B5007p)
Report Version: 104

Exception Type: EXC_CRASH (SIGABRT)
Crashed Thread: 0

Application Specific Information:
Class MPAppDelegateProxy implements _wantsPriorityOverFocusUpdates, which is no longer supported.

Thread 0 Crashed:
0   CoreFoundation                  0x30fd0611c         __exceptionPreprocess
1   libobjc.A.dylib                 0x30a372694         objc_exception_throw
2   Foundation                      0x30dd0fa78         -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:]
3   UIKitCore                       0x315431198         -[UIResponder(UIFocusAdditions) _shouldSkipKeyCommand:forMovement:]
4   UIKitCore                       0x3162042e4         -[_UIFocusEventDelivery shouldSkipKeyCommand:whenDeliveringFocusKeyboardEvent:toResponder:]
5   UIKitCore                       0x315d27064         -[UIApplication _handleKeyboardPressEvent:]
6   UIKitCore                       0x315d18fc0         -[UIApplication pressesBegan:withEvent:]
7   UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
8   UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
9   UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
10  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
11  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
12  UIKitCore                       0x314ec658c         forwardTouchMethod
13  UIKitCore                       0x31565d93c         -[UITabBarController pressesBegan:withEvent:]
14  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
15  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
16  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
17  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
18  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
19  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
20  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
21  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
22  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
23  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
24  UIKitCore                       0x314ec658c         [inlined] forwardTouchMethod
25  UIKitCore                       0x314ec658c         forwardTouchMethod
26  UIKitCore                       0x315d391e0         -[UIWindow _sendButtonsForEvent:]
27  UIKitCore                       0x314f14218         -[UIWindow sendEvent:]
28  UIKitCore                       0x314da8058         -[UIApplication sendEvent:]
29  NethoneSDK                      0x107dbf810         <redacted>
30  UIKitCore                       0x315d26564         -[UIApplication _handleKeyUIEvent:]
31  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
32  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
33  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
34  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
35  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
36  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
37  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
38  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
39  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
40  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
41  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
42  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
43  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
44  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
45  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
46  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
47  UIKitCore                       0x315d35834         [inlined] -[UIResponder _handleKeyUIEvent:]
48  UIKitCore                       0x315d35834         -[UIResponder _handleKeyUIEvent:]
49  UIKitCore                       0x315d265e8         -[UIApplication handleKeyUIEvent:]
50  UIKitCore                       0x315d264ac         -[UIApplication _handleKeyHIDEvent:usingSyntheticEvent:]
51  UIKitCore                       0x314da9360         __dispatchPreprocessedEventFromEventQueue
52  UIKitCore                       0x314db22f0         __processEventQueue
53  UIKitCore                       0x314ca9f50         updateCycleEntry
54  UIKitCore                       0x314ca7da4         _UIUpdateSequenceRun
55  UIKitCore                       0x314ca79f4         schedulerStepScheduledMainSection
56  UIKitCore                       0x314ca88b8         runloopSourceCallback
57  CoreFoundation                  0x30fcd8f8c         __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
58  CoreFoundation                  0x30fcd8f20         __CFRunLoopDoSource0
59  CoreFoundation                  0x30fcd6a0c         __CFRunLoopDoSources0
60  CoreFoundation                  0x30fcd5c10         __CFRunLoopRun
61  CoreFoundation                  0x30fcd54c4         CFRunLoopRunSpecific
62  GraphicsServices                0x3a8de31c0         GSEventRunModal
63  UIKitCore                       0x314fdc57c         -[UIApplication _run]
iMostfa commented 1 month ago

Hi @samdozor will appreciate if you take a look here

iMostfa commented 3 weeks ago

Hi, @BrandonStalnaker @einsteinx2

can you please check this issue ?

iMostfa commented 3 weeks ago

checking this: https://github.com/mParticle/mparticle-apple-sdk/issues/237#issuecomment-1795157390

and i would say that we really wish to get this fixed from your side, because the SDK is what's triggering this issue in apple's side.

einsteinx2 commented 3 weeks ago

Hi @iMostfa, originally I had pushed back on adding a workaround to the SDK as it seemed like a temporary Apple bug and I didn't want to add tech debt for a transient issue. As this is clearly still affecting people, I've created an internal ticket to track the work and add a workaround.

I will attempt to reproduce on my end and will implement either the originally proposed fix or another one into the SDK to resolve the issue without changes required on your side other than upgrading to the latest SDK. I should be able to have it out this week.

I'll reply back here and close the issue once the workaround is released.

Tracking internally as: https://go.mparticle.com/work/SQDSDKS-6650

iMostfa commented 3 weeks ago

@einsteinx2 Thanks a lot, i will wait for your response.

iMostfa commented 2 weeks ago

@einsteinx2 hi, is there any updates/progress related to this one ?

BrandonStalnaker commented 2 weeks ago

@iMostfa We've been able to recreate the issue using the steps you provided but haven't found a way to prevent the crash yet. iPad apps crashing from external keyboards seems to be a common and varied issue unfortunately. The problem is obvious but the only solution that seems to work is not using the appDelegateProxy which most of our clients would prioritize having over fixing this issue. If you've found a workaround please let us know here.

iMostfa commented 1 week ago

Thanks for the update @BrandonStalnaker it's really disappointing, most likely we will end up turning off the proxy for iPad users, and implement needed appDelegate functions,

do you happen to know if this doc is updated ? and if i user other SDK that integrates with mParticle, should we implement more methods in appDelegate ?