DeckKit icon indicating copy to clipboard operation
DeckKit copied to clipboard

Invalid sample AnimatablePair warning

Open gavtron2000 opened this issue 1 year ago • 8 comments

Hi there. Thanks for your work on DekKit. I'm seeing some warnings pop up in the console when running on device:

Invalid sample AnimatablePair<AnimatablePair<CGFloat, CGFloat>, AnimatablePair<CGFloat, CGFloat>>(first: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: -0.6666666666666643, second: 0.0), second: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: 0.0, second: 0.0)) with time Time(seconds: 0.0) > last time Time(seconds: 0.016677249979693443)

I can't diagnose the cause etc, but I wanted to let you know.

gavtron2000 avatar Sep 08 '24 08:09 gavtron2000

Did you email the wrong person?  I’ve got no context for this issue. David Koontz     Email: @.***     (360) 259-8380     http://about.me/davidakoontzOn Sep 8, 2024, at 2:06 AM, Gavin @.***> wrote: Hi there. Thanks for your work on DekKit. I'm seeing some warnings pop up in the console when running on device:

Invalid sample AnimatablePair<AnimatablePair<CGFloat, CGFloat>, AnimatablePair<CGFloat, CGFloat>>(first: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: -0.6666666666666643, second: 0.0), second: SwiftUI.AnimatablePair<CoreGraphics.CGFloat, CoreGraphics.CGFloat>(first: 0.0, second: 0.0)) with time Time(seconds: 0.0) > last time Time(seconds: 0.016677249979693443)

I can't diagnose the cause etc, but I wanted to let you know.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

davidakoontz avatar Sep 08 '24 22:09 davidakoontz

Thank you @gavtron2000 - I see it too 🤔

I haven't seen it before, wonder if it's something new.

Other people seem to have it too:

https://www.reddit.com/r/SwiftUI/comments/1ekye64/anybody_know_what_the_invalid_sample_animatable/

https://stackoverflow.com/questions/77836428/swiftui-changing-view-position-with-drag-raises-ui-bug

https://github.com/aheze/SwipeActions/issues/22

Seems to be an underlying iOS bug.

danielsaidi avatar Sep 09 '24 06:09 danielsaidi

Thanks @danielsaidi sorry I can't give any insight on how to fix it!

gavtron2000 avatar Sep 10 '24 10:09 gavtron2000

@gavtron2000 No worries, I'm just happy you notified me.

However, it might just be some iOS system logging that shouldn't be there. Do you see any strange behavior when using the deck component?

danielsaidi avatar Sep 10 '24 11:09 danielsaidi

My client has noticed some crashing when swiping through the deck component, which I'm trying to isolate. There is a very real possibility it is being caused by my code, but I noticed the errors when trying to isolate the bug.

gavtron2000 avatar Sep 10 '24 11:09 gavtron2000

Perfect, let's keep this open in case we find something on our respective ends 👍

danielsaidi avatar Sep 10 '24 11:09 danielsaidi

I'm not sure about the implementation here but in my case this bug came from changing a value on drag that affects an offset. I fixed it by using withAnimation for the new value. I had to make the animation linear and very fast otherwise it would be slow for my use case

Mohamad-Kredly avatar Mar 17 '25 20:03 Mohamad-Kredly

The new DeckView version lets you customize the state change animation, so perhaps this is easier to investigate this now?

danielsaidi avatar Mar 28 '25 09:03 danielsaidi