Skip to content

fix(animation): avoid uncaught reject on cancel #10309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

NathanWalker
Copy link
Contributor

PR Checklist

What is the current behavior?

Currently any in-flight animation can be auto cancelled by any number of user interactions - navigation, tap to interact with screens, or explicit cancels. All will reject the promise of which don't need to be caught but still cause numerous uncaught errors. These can manifest into UI bugs when uncaught under various conditions.

Error: Animation cancelled. Error: Animation cancelled.
      at Animation._rejectAnimationFinishedPromise (file: src/webpack:/myp/node_modules/@nativescript/core/ui/animation/animation-common.js:102:0)
      at AnimationDelegateImpl.animationFinishedCallback [as _finishedCallback] (file: src/webpack:/myp/node_modules/@nativescript/core/ui/animation/index.ios.js:158:0)
      at AnimationDelegateImpl.animationDidStopFinished (file: src/webpack:/myp/node_modules/@nativescript/core/ui/animation/index.ios.js:79:0)
  Unhandled Promise rejection: Animation cancelled. ; Zone: <root> ; Task: Promise.then ; Value: Error: Animation cancelled. Error: Animation cancelled.
      at Animation._rejectAnimationFinishedPromise (file: src/webpack:/myp/node_modules/@nativescript/core/ui/animation/animation-common.js:102:0)
      at AnimationDelegateImpl.animationFinishedCallback [as _finishedCallback] (file: src/webpack:/myp/node_modules/@nativescript/core/ui/animation/index.ios.js:158:0)
      at AnimationDelegateImpl.animationDidStopFinished (file: src/webpack:/myp/node_modules/@nativescript/core/ui/animation/index.ios.js:79:0)

What is the new behavior?

Animation cancellations resolve and no longer pose a threat to apps stability.

@NathanWalker NathanWalker requested a review from rigor789 June 12, 2023 21:20
@nx-cloud
Copy link

nx-cloud bot commented Jun 12, 2023

☁️ Nx Cloud Report

Attention: This version of the Nx Cloud GitHub bot will cease to function on July 1st, 2023. An organization admin can update your integration here.

CI is running/has finished running commands for commit cee09ee. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


🟥 Failed Commands
nx run apps-automated:ios --timeout=600
✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@cla-bot cla-bot bot added the cla: yes label Jun 12, 2023
@NathanWalker NathanWalker merged commit 622f365 into main Jun 13, 2023
@NathanWalker NathanWalker deleted the fix/animation-cancel-avoid-uncaught-reject branch June 13, 2023 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant