| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Can one of the admins verify this patch? |
Sorry, something went wrong.
|
Can one of the admins verify this patch? |
Sorry, something went wrong.
|
Can one of the admins verify this patch? |
Sorry, something went wrong.
|
Hey Nathan, Trying to cancel() an animation that is not currently playing is probably caused by an error in the application code - thus we decided to throw in such cases. If it is intentional - you can always do the check with isPlaying? |
Sorry, something went wrong.
|
Thanks @vakrilov - we always check isPlaying before attempting to call cancel. It's a side effect likely as a result of CSS processing keyframe animations in unforeseen ways (views getting destroyed when navigating or some other reasons, etc) - that neither you nor I can anticipate and really should not be considered exceptional. A brief inspection of tns-core-modules reveals 198 matches across 67 files where athrow is raised. https://stackoverflow.com/a/77164
@vakrilov Is this animation condition truly exceptional?
The framework core currently makes developing bug free apps more difficult due to the extraneous and voluminous usage of throw. What do you recommend? |
Sorry, something went wrong.
|
Hey @NathanWalker Looking at the crash analysis report you've attached - it is the exception thrown in keyframe-animation.ts file that is causing trouble, so I would suggest applying this approach in this file also. As for throwing exceptions in general - I absolutely agree that exceptions should not be used as a control flow mechanism. Non of that APIs in the core framework are designed in a way that requires you to catch exceptions in order achieve your goal. What we do use as a guiding principle when writing code is fail early/fail early. Most of the throw statements in the code are there to warn you about a problem on the first possible place when it is visible. It is better to get a crash with a stack-trace than debug a program that is just not working and you don't know why. The exceptions are meant to point you to the exact place of a potential bug while you are developing and testing, not to crash your app in production. That said, I don't agree that judging the quality and ergonomics of a framework, based on the number of throws in the code is fair. |
Sorry, something went wrong.
|
Thank you for the understanding @vakrilov and pointing out keyframe-animation.ts file, likely the worst offender since CSS animation issues have been reported by others in several other outlets (forums,issues,etc.). I have updated the PR to include an adequate fix for that file as well. Big believer in fail fast/fail early however around animation handling doing the correct thing to help a sequence continue/succeed vs. fail is a far better route to take. Consider the comment in the SO post you mentioned:
The browser vendors do the right thing. Here we want to help an animation sequence/condition continue while still allowing the developer to dive deeper by turning tracing on to gain deeper insight if they need to. An appreciated priority would be on ensuring dev's can create animations via CSS keyframes or otherwise without coming to find out some 1% of users find a path that was impossible to find during testing and worse not even fixable by the developer themselves as is the case here since it is coming from the core framework in use. 1% of a 1.5 million user base is 15,000 users that were adversely affected by the throw that this PR effectively solves. Please let me know if there are other concerns to these changes and I can adjust per your advice. |
Sorry, something went wrong.
| traceWrite("Animation is already playing.", traceCategories.Animation, 2); | ||
| } | ||
| return <AnimationPromiseDefinition>new Promise<void>((resolve, reject) => { | ||
| reject(); |
There was a problem hiding this comment.
Can you add Animation is already playing. as a reason for rejecting.
Sorry, something went wrong.
| traceWrite("Keyframe animation is already playing.", traceCategories.Animation, 2); | ||
| } | ||
| return new Promise<void>((resolve, reject) => { | ||
| reject(); |
There was a problem hiding this comment.
Can you add Keyframe animation is already playing as a reason for rejecting
Sorry, something went wrong.
|
Hey thanks for your explanations. I have run the CI tests. Can I ask you to write a couple of unit tests (probably in animation-tests.ts assuring this behavior:
|
Sorry, something went wrong.
Fixes major cause of crashes/bugs in production apps using animation.
Sorry, something went wrong.
|
Any way we could see this in a hotfix release? This appears to have been a regression in 3.4.x. I had none of these before 3.4, but 3.4 seems to have surfaced this and I'm seeing it at around a ~2% user rate in production. I'd be happy to take an rc tagged build for this to roll out to production for confirmation. |
Sorry, something went wrong.
|
@NathanWalker the unit tests you have written seem to fail now on Android (that's what test do). Indeed that was helpful because seems there is something we've missed. There is a platform-specific implementation for both play() and cancel() methods for android and ios. The code there will still execute even though the super.play()/super.cancel() calls do not throw. |
Sorry, something went wrong.
There was a problem hiding this comment.
You can slip these // >> comments in the tests. They are not related to testing, we use them to generate code snippets for the docs from the wrapped sections.
Sorry, something went wrong.
|
Ok excellent I’ll fix that up tomorrow since I’m going to bed now. If you knew the fix and wanted to pull my branch to finish it up would be fine, otherwise I’ll get in morning. |
Sorry, something went wrong.
Sorry, something went wrong.
* chore(tests): Cleanup code snippets comments * refactor(animations): Plat-specific cancel and play methods refactored
|
Perfection thank you 👍 |
Sorry, something went wrong.
|
test |
Sorry, something went wrong.
This addition adds more insight into iOS crashes, especially for failures in JS that result in the crash. Using this logging we were able to identify this issue: NativeScript/NativeScript#5475 which otherwise would have been impossible to trace, as it had a 5% repro among users but never occurred internally.
|
@vakrilov I'm unable to see the jenkins test detail - just lemme know if any other modifications are needed to get those to clear 👍 - thanks again. |
Sorry, something went wrong.
|
test branch_animations#master |
Sorry, something went wrong.
|
Hey @NathanWalker we are currently investigating the failed tests from the CI and I need some time. I just want to let you know that we are working on it. Most probably the issue is not related to this PR but I need to be sure. |
Sorry, something went wrong.
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes cause of crashes/bugs in production apps using animation.
PR Checklist
What is the current behavior?
Developers create apps using animation library and under normal circumstances and well coded scenarios the app will throw when navigating or other normal app usage causing bugginess.
What is the new behavior?
Developers can now see the warning in the console when developing if tracing is enabled to let them know but keep their app stable.
Cause of instability in production Portable North Pole
See screenshot of Crashlytics reports on this.
/cc @atanasovg @vakrilov @sis0k0 @DickSmith