SRGSSR / srgletterbox-apple

The official SRG SSR media playback experience
https://srgssr.github.io/marketing/letterbox/
MIT License
14 stars 7 forks source link

Timeline scrolling crashes #224

Closed defagos closed 4 years ago

defagos commented 4 years ago

I found rare crashes on App Store Connect:

Last Exception Backtrace:
0   CoreFoundation                  0x1b7c75ea4 __exceptionPreprocess + 228 (NSException.m:172)
1   libobjc.A.dylib                 0x1b6e45a50 objc_exception_throw + 56 (objc-exception.mm:557)
2   CoreFoundation                  0x1b7b7c484 +[NSException raise:format:] + 116 (NSException.m:145)
3   UIKitCore                       0x1e44687b8 -[UICollectionView _contentOffsetForScrollingToItemAtIndexPath:atScrollPosition:] + 224 (UICollectionView.m:4748)
4   UIKitCore                       0x1e4468ed0 -[UICollectionView _scrollToItemAtIndexPath:atScrollPosition:animated:] + 72 (UICollectionView.m:4838)
5   Play SRF                        0x1005eb838 __61-[SRGLetterboxTimelineView scrollToCurrentSelectionAnimated:]_block_invoke.117 + 120 (SRGLetterboxTimelineView~ios.m:255)
6   libdispatch.dylib               0x1b76ad6c8 _dispatch_call_block_and_release + 24 (init.c:1372)
7   libdispatch.dylib               0x1b76ae484 _dispatch_client_callout + 16 (object.m:511)
8   libdispatch.dylib               0x1b765a9a4 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1068 (inline_internal.h:2441)
9   CoreFoundation                  0x1b7c05ce4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12 (CFRunLoop.c:1813)
10  CoreFoundation                  0x1b7c00bac __CFRunLoopRun + 1964 (CFRunLoop.c:3113)
11  CoreFoundation                  0x1b7c000e0 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3247)
12  GraphicsServices                0x1b9e79584 GSEventRunModal + 100 (GSEvent.c:2245)
13  UIKitCore                       0x1e4b8cc00 UIApplicationMain + 212 (UIApplication.m:4347)
14  Play SRF                        0x10018dab4 main + 88 (main.m:14)
15  libdyld.dylib                   0x1b76bebb4 start + 4

These can be mitigated in the same way as we did in Play (trapping the exception, if any).

defagos commented 4 years ago

Ready for code review on the feature/crash-mitigation branch.