You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
MGLOfflineStorage calls DefaultFileSource::resume() more than once #8464
#8194 and #8125 introduced a mechanism to pause and resume mbgl file source activity. #8125 specifically modified MGLOfflineStorage to pause the file source in response to UIApplicationDidEnterBackgroundNotification and resume in response to UIApplicationWillEnterForegroundNotification.
Based on a crash reported captured from an internal testing application (see below), it appears that the resume method is called twice in some cases which leads to a crash.
I think our mbgl implementation is correct to enforce symmetry in the calls to pause and resume. Along with some extra logging, I'm going to try adding a boolean in MGLOfflineStorage to keep the state of pause and resume and guard against invalid calls to mbgl. This will hopefully allow me to confirm that this type of solution stops the crash and, unfortunately, it is the only solution I can think of at the moment.
This reminds me of how we had to work around the fact that iOS 9.0 (and above?) would send redundant reachability notifications on launch: #1911. In #1958, we similarly worked around the issue by keeping track of the old and new reachability states.
Activity
boundsj commentedon Mar 18, 2017
Noting that it does not look like it is unheard of for observers of life cycle notifications to be tricked by the system https://openradar.appspot.com/14075101.
I think our mbgl implementation is correct to enforce symmetry in the calls to pause and resume. Along with some extra logging, I'm going to try adding a boolean in MGLOfflineStorage to keep the state of pause and resume and guard against invalid calls to mbgl. This will hopefully allow me to confirm that this type of solution stops the crash and, unfortunately, it is the only solution I can think of at the moment.
1ec5 commentedon Mar 18, 2017
This reminds me of how we had to work around the fact that iOS 9.0 (and above?) would send redundant reachability notifications on launch: #1911. In #1958, we similarly worked around the issue by keeping track of the old and new reachability states.
boundsj commentedon Mar 19, 2017
This was fixed in #8465 on the
release-ios-v3.5.0-android-v5.0.0branch.