Closed Bug 2001590 Opened 18 days ago Closed 15 days ago

AnimationsActor methods can be called with AnimationPlayerActors that are not handled anymore

Categories

(DevTools :: Inspector: Animations, defect)

defect

Tracking

(firefox147 fixed)

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(1 file)

On the AnimationsActor, we have a few methods that can be called with AnimationPlayerActors https://searchfox.org/firefox-main/rev/70425199e9a5fa80aa7419fa51763013a67226e1/devtools/server/actors/animation.js#795,798-800,808,811-813,821,824,827-828,846,849,851-852

/**
...
 * @param {Array} actors A list of AnimationPlayerActor.
 */
pauseSome(actors) {
...
/**
...
 * @param {Array} actors A list of AnimationPlayerActor.
 */
playSome(actors) {
...
/**
...
 * @param {Array} players A list of AnimationPlayerActor.
...
 */
setCurrentTimes(players, time, shouldPause) {
...
/**
...
 * @param {Array} actors A list of AnimationPlayerActor.
...
 */
setPlaybackRates(players, rate) {

This is subject to race conditions: the client might call this while the AnimationsActor is sending a mutations event indicating that some animations were removed.
Then, performing any action on those player (pausing, setting time, …) might actually trigger a new, unwanted, mutation, which will cause both the server state and the client state to be out of date.

To fix this, we should filter out actors which are not into AnimationsActor#actors array.

AnimationActor pauseSome, playSome, setCurrentTimes and setPlaybackRates
all take an array of AnimationPlayerActor instances for which we'll perform
some operation on their underlying animation.
It can happen that some of those actors are not handled by the AnimationsActor
anymore (e.g. the animation stopped, but the client wasn't updated yet).

Performing any action on those unhandled player (pausing, setting time, …) might
actually trigger a new, unwanted, mutation, which will cause both the server
state and the client state to be out of date.

This patch filters out actors which are not into AnimationsActor#actors to avoid
such issue.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/8188dec434a7 https://hg.mozilla.org/integration/autoland/rev/ec9e3f67f0ea [devtools] Filter out `AnimationPlayerActor` instances that aren't handled by `AnimationsActor`. r=devtools-reviewers,bomsy.
Status: ASSIGNED → RESOLVED
Closed: 15 days ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
QA Whiteboard: [qa-triage-done-c148/b147]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: