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
Interesting point! I never came across that problem myself, but you are completely right:
We should make the comparison less strict and anticipate a bounded error.
I'll fix that and check all similar progress related methods for similar errors.
To be honest, I tried to reproduce this behavior in a unit test and failed :).
However I will monitor this problem closer maybe I will be able to find the exact constellation.
progress: is now less strict and anticipates an uncertainty within FLT_EPSILON, see commit 2a14c4e. I also added a corresponding test.
Do you mind checking if your problem still exists using this version? If so, re-open the ticket please! ;)
From Time to time I see assertion failure
https://github.com/b52/OMPromises/blob/master/Classes/Core/OMDeferred.m#L90
NSAssert(self.progress <= progress, @"Progress can only increase");
Even though the progress is equal.
Please have a look at this article.
http://stackoverflow.com/questions/10334688/how-dangerous-is-it-to-compare-floating-point-values
In the comments you can find explanation and solution for the issue.
My suggestion for a quick fix:
NSAssert(self.progress - progress < 0.001, @"Progress can only increase");
The text was updated successfully, but these errors were encountered: