Closed reidmain closed 5 years ago
Sorry for the late reply, I was away travelling. I can reproduce the crash and will look into it soon. If you have made any progress yourself in the meantime, please let me know. Thanks!
No worries @Thomvis. I know maintaining an open source project is tough.
I unfortunately have not had any opportunity to dig into this deeper. I was attempting to port some code from Bolts to BrightFutures but then got switched over to another project. If I get the opportunity to circle back around to this I'll update the issue with my findings.
In our app we have a method that makes a network request and returns a Future. If that method is called before the Future is fulfilled the same future object gets returned instead of making another network request and creating another Future.
When I was writing a test to ensure that if you called this method multiple times only a single network request was made I would constantly get a crash in
Async.onComplete((() -> ()) -> (), callback : (A) -> ()) -> Self at /Users/reid/app/Carthage/Checkouts/BrightFutures/Sources/BrightFutures/Async.swift:123
After some poking around I was able to replicate the problem with the following block of code:
This crashes every time on Xcode 8.3.3 against iOS 10.3.
Something interesting to mention is that if you remove the delay and only use
DispatchTime.now()
then this code executes perfectly.I am using v5.2.0 of BrightFutures.