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
Describe the bug
I am using the pod of latest versions of Instructions(1.3.1). There is a random crash happening which is frequent. Attached here the screen shot. The crash is on 225 line number in file CoachMarkLayoutHelper. Here is the code:
let segmentIndex = Int(ceil(2 * pointOfInterest.x / frame.size.width))
Looks like at some moment, the frame.size.width is 0 which makes it crash.
To Reproduce
Happening randomly and not reproducible
I put a partial fix in 1.4.0. It should no longer crash, falling back to a default alignment. But that won't solve the underlying issue. Can you share with me the full stack trace? I'd like to understand under what circumstances the frame could be nil. I believe this is a long-standing issue.
@vinayakparmar92 from the stack trace, I assume that you previously paused the flow and you are starting it again, is that correct? Which PresentationContext are you using?
Instructions is crashing because an internal view (instructionsRootView) likely has a .zero frame when trying to lay out the coach marks, which is an edge case I can't wrap my head around. Maybe you are doing something I never thought about?
@vinayakparmar92 from the stack trace, I assume that you previously paused the flow and you are starting it again, is that correct? Which PresentationContext are you using?
Instructions is crashing because an internal view (instructionsRootView) likely has a .zero frame when trying to lay out the coach marks, which is an edge case I can't wrap my head around. Maybe you are doing something I never thought about?
Yes! I ask a singleton manager to present the Coachmark/Instruction which takes a callback. That callback will return a boolean if its the right moment to present the coachmark, if not then it will present it later. The CoachMarksController instance is alive during the whole cycle. I used the below method to invoke that callback to return if it should present or not
Activity
Partial fix for #218 - division by zero
ephread commentedon Oct 5, 2019
I put a partial fix in 1.4.0. It should no longer crash, falling back to a default alignment. But that won't solve the underlying issue. Can you share with me the full stack trace? I'd like to understand under what circumstances the frame could be nil. I believe this is a long-standing issue.
vinayakparmar92 commentedon Oct 5, 2019
@ephread Thank you that you tried a fix. Mentioned below the full stack trace
ephread commentedon Oct 14, 2019
@vinayakparmar92 from the stack trace, I assume that you previously paused the flow and you are starting it again, is that correct? Which
PresentationContextare you using?Instructions is crashing because an internal view (
instructionsRootView) likely has a.zeroframe when trying to lay out the coach marks, which is an edge case I can't wrap my head around. Maybe you are doing something I never thought about?vinayakparmar92 commentedon Oct 16, 2019
Yes! I ask a singleton manager to present the Coachmark/Instruction which takes a callback. That callback will return a boolean if its the right moment to present the coachmark, if not then it will present it later. The
CoachMarksControllerinstance is alive during the whole cycle. I used the below method to invoke that callback to return if it should present or notPartial fix for ephread#218 - division by zero