CarPlay App Hang: CPMapTemplate.isPanningInterfaceVisible blocks main thread #32
Closed
LukasB-DEV
started this conversation in
Ideas
Replies: 3 comments
|
Nice catch, we didn't spot that so far. |
0 replies
|
fixed with #33, thanks for your support @LukasB-DEV |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I’m seeing an App Hang (main‑thread stall) in CarPlay that appears to be caused by a synchronous call to
CPMapTemplate.isPanningInterfaceVisibleinsideMapTemplate._invalidate().What I see (Sentry):
CPMapTemplate.isPanningInterfaceVisibleMapTemplate._invalidate→AutoPlayTemplate.invalidate→HybridAutoPlay.setRootTemplate(async job)semaphore_timedwait_trapEnvironment:
Reproduction (best‑effort):
invalidate()(e.g. header/actions update or navigation start/stop)This seems timing‑sensitive and may be specific to newer iOS/CarPlay behavior.
Why I think this is the cause:
CPMapTemplate.isPanningInterfaceVisibleappears to use an internal semaphore/IPC. If called synchronously on the main thread while CarPlay is changing panning state, it can block briefly. Our stack trace shows the hang inside that call.Proposed fix (minimal):
mapTemplateDidShowPanningInterface/mapTemplateDidDismissPanningInterfaceisPanningInterfaceVisibleaccess in_invalidate()/onPanButtonPress/ zoom handling with the cached flaginvalidate()from the delegate callbacks to the next runloop (DispatchQueue.main.async) to avoid re‑entrancy during CarPlay callbacksWould you like me to open a PR with this change?
Thanks!
All reactions