Closed mtrezza closed 7 years ago
can you tryout that branch modernization-without-bolts
with cocoapods?
I'm not using pods, but looking at the code I think it would solve the issue.
@mtrezza this should also work with Carthage!
@flovilmart works without error. what is this branch - is it safe for production?
Should be, I was wondering if it could be tested before merge/release!
Looks good so far, no compile or runtime warnings/errors in Xcode 9, iOS 11, Swift 4. I'll be using it for development from now on. Anything specific that should be tested?
I,m usure about the dispatch_sync call there: https://github.com/parse-community/Parse-SDK-iOS-OSX/pull/1186/files#diff-0ca981762244e8376faf320ec0704646R129
if something else is blocking the main queue (like a task.wait()) this could deadlock
Right, the wait()
did pause the main queue and the location manager block never executed:
let dispatch = DispatchGroup()
dispatch.enter()
PFGeoPoint.geoPointForCurrentLocation { (geoPoint, error) in
// Never got to here...
dispatch.leave()
}
dispatch.wait()
However since CLLocationManager
has to be called on the main queue I think it is simply not an option to pause the main queue when calling PFGeoPoint.geoPointForCurrentLocation
. Maybe it would be enough to mention this in the declaration of PFGeoPoint.geoPointForCurrentLocation
.
Yeah, calling wait on the main queue will block :/ also, in normal usage, do you think it will be an issue?
I’ll use dispatch async instead of dispatch sync
Yeah, I think async
is the way to go. Do you see any reason why it should be sync
rather than async
?
I just pushed on the branch, but I'm not sure the semaphore will not deadlock your app as it still needs to jump back on the main queue to check the application state.
On 23 sept. 2017 09:00 -0400, Manuel notifications@github.com, wrote:
Yeah, I think async is the way to go. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
Actually, I think it doesn't make any difference whether it's sync
or async
, in any case the main queue is blocked. I will try out your push.
Main queue is blocked also with async
. Maybe just add to the docs of geoPointForCurrentLocation
that it executes on the main thread and thus main cannot be paused. It's justifiable as the constraint exists by iOS design.
@mtrezza what do you thinks about that? https://github.com/parse-community/Parse-SDK-iOS-OSX/pull/1186/commits/18e002d40fccb9e6ce8d41ae30681d6f05ab911a#diff-eb4040482e1391e16621c54aab7cded9R60
I'd say perfect and ready for merge
What is the Bolts change in this branch about?
there's not changes in bolts yet. There's a PR pending to use queue for synchronization instead of locks so the thread sanitizer is happy :)
Allright then 👍
I'm still waiting for the review on Bolts and a release to be able to bump to the latest version. I'll merge this one and release
Fixed in 0ca981762244e8376faf320ec0704646R129
Thanks for the testing!
Thanks @flovilmart, that makes the SDK iOS 11 ready.
A tad late, sorry about that :/
Still in good time I think :)
Found my way here. Once I can get Parse 1.15.3 working (already posted in relevant thread), hopefully this "Main Thread Checker" warning will be fixed.
After updating to iOS 11, Swift 4 and Xcode 9, calling
PFInstallation.saveInBackground
throws the error:Error seems to be related to this, which should be executed on the main thread:
https://github.com/parse-community/Parse-SDK-iOS-OSX/blob/7a820b75c6726808475af9ce705053ff0e8cbd11/Parse/Internal/PFApplication.m#L74-L82