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
fix(platform-browser): update started state on reset #41608
fix(platform-browser): update started state on reset #41608
Conversation
packages/platform-browser/animations/test/browser_animation_builder_spec.ts
Outdated
Show resolved
Hide resolved
5c0c9ed
to
3408433
Compare
packages/platform-browser/animations/test/browser_animation_builder_spec.ts
Outdated
Show resolved
Hide resolved
packages/platform-browser/animations/test/browser_animation_builder_spec.ts
Outdated
Show resolved
Hide resolved
d9b8a9e
to
436ff83
Compare
packages/platform-browser/animations/test/browser_animation_builder_spec.ts
Show resolved
Hide resolved
packages/platform-browser/animations/test/browser_animation_builder_spec.ts
Outdated
Show resolved
Hide resolved
68f35cc
to
c5391cb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iRealNirmal the change looks good, I'm wondering if we should reset _started
flag to false
in finish
and destroy
methods too (for completeness)? // cc @petebacondarwin
(I will remove "presubmit" flag for now, since additional changes might be required)
I suggested setting it to false at finish, but @iRealNirmal pointed out that this could be a breaking change, and it is not clear from the docs and the interface what |
@AndrewKushnir I was just worried if other world project are using that flag to know if it was played already or not. If we do that change this will surely break it for them. Regarding ondestory I don't think we need to set it but ondone / onfinish can be case for reset but for that also I would need clear consent from you or any person from your team. As soon you can provide me consent where I should change the state( list will be helpful), I will do it. |
what about |
I would like to keep both things separate. When you are asking about isPaused(), I am thinking it more like feature not a fix. Regarding answer your question regarding viable, yes some time investment and it will be done. But still I would prefer a different ticket for isPaused to have history. Coming back to hasStarted I would like more clarity from functionality aspect maybe @petebacondarwin and @AndrewKushnir can do some internal brainstorm with other team members. Doing any changes which is not clear is not a good idea I own self wouldn't approve that PR. |
Hi @iRealNirmal and @0biWanKenobi (got to love that zero). @AndrewKushnir and I just had a long chat about this. There is no one on the team at the moment who understands the animations package deeply or knows all of the history as to why the APIs were designed as they are. It seems that the What is more worrying is that there are different behaviours between different players. Some of them do reset the hasStarted(): boolean {
return this._state >= AnimatorControlState.STARTED;
} In this case, We believe that it is probably the case that Here are the implementation of
Further, if one wants to know the current state of the animation then it seems that we should lean on the |
thanks @petebacondarwin and @AndrewKushnir understood what I have to do, Will take care of it. |
@iRealNirmal since this PR changes a d.ts file (testing.d.ts), additional reviews from the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🍪
reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-for: public-api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm approving this from the public API perspective, but I noticed that the commit message is very sparse, especially compared to the discussion on this PR.
@iRealNirmal, can you update the commit message to capture:
- what the previous behavior was prior to this fix
- why that behavior was wrong, and what consequence it had
- what the new behavior is after the fix
Thanks!
sure will do. |
2638277
to
0588997
Compare
Any update on this PR ? |
Hi @iRealNirmal, sorry for the delay, I've started a new presubmit and will keep this thread updated. |
This commit fixes the state of variable _started on call of reset method. Earlier behaviour was on call of `reset()` method we are not setting back `_started` flag's value to false and it created various issue for end user which were expecting this behaviour as per name of method. We provided end user `reset()` method, but it was empty method and on call of it wasn't doing anything. As end user/developer were not able to reuse animation not animation after call of reset method. In this PR on call of `reset()` method we are setting flag `_started` value to false which can be accessed by `hasStarted()`. Resolves angular#18140
0588997
to
c970d9c
Compare
@iRealNirmal FYI presubmits went well and since the PR was marked for merge before, I'm adding that label back. I've also rebased this PR to re-run CI and if it's still "green", the PR should be fully ready for merge. Thank you. |
This commit fixes the state of variable _started on call of reset method. Earlier behaviour was on call of `reset()` method we are not setting back `_started` flag's value to false and it created various issue for end user which were expecting this behaviour as per name of method. We provided end user `reset()` method, but it was empty method and on call of it wasn't doing anything. As end user/developer were not able to reuse animation not animation after call of reset method. In this PR on call of `reset()` method we are setting flag `_started` value to false which can be accessed by `hasStarted()`. Resolves #18140 PR Close #41608
This commit fixes the state of variable _started on call of reset method. Earlier behaviour was on call of `reset()` method we are not setting back `_started` flag's value to false and it created various issue for end user which were expecting this behaviour as per name of method. We provided end user `reset()` method, but it was empty method and on call of it wasn't doing anything. As end user/developer were not able to reuse animation not animation after call of reset method. In this PR on call of `reset()` method we are setting flag `_started` value to false which can be accessed by `hasStarted()`. Resolves angular#18140 PR Close angular#41608
This commit fixes the state of variable _started on call of reset method. Earlier behaviour was on call of `reset()` method we are not setting back `_started` flag's value to false and it created various issue for end user which were expecting this behaviour as per name of method. We provided end user `reset()` method, but it was empty method and on call of it wasn't doing anything. As end user/developer were not able to reuse animation not animation after call of reset method. In this PR on call of `reset()` method we are setting flag `_started` value to false which can be accessed by `hasStarted()`. Resolves angular#18140 PR Close angular#41608
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit fixes the state of variable _started on call of reset method.
Resolves #18140
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
on call of hasStarted method after reset method is returning true.
Issue Number: #18140
What is the new behavior?
After calling reset method, hasstarted method will return false.
Does this PR introduce a breaking change?
Other information