Skip to content
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 enabling of media object action buttons #5947

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

masaball
Copy link
Contributor

On page load, both initial and refreshed, in mobile browsers there was some sort of race condition that was disabling the Add to Playlist, Timeline, and Thumbnail buttons immediately after being enabled. Changing the event listener for disabling the buttons to be triggered on the player emptying instead of loading seems to fix that race condition, but uncovered a separate one when switching canvases. This second race condition behaved similarly to the first, where the enabling function would be run before the disabling function. Adding a fallback enabling function that triggers on loadstart seems to fix this second race condition. There may still be some flakiness, especially on apple devices, because events triggering properly sometimes just doesn't happen.

Related issue: #5885

Wait to merge until after 7.8

Dananji
Dananji previously approved these changes Jul 18, 2024
Copy link
Contributor

@Dananji Dananji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!
This was a tricky one for sure 😌

On page load, both initial and refreshed, in mobile browsers there was
some sort of race condition that was disabling the Add to Playlist,
Timeline, and Thumbnail buttons immediately after being enabled.
Changing the event listener for disabling the buttons to be triggered on
the player emptying instead of loading seems to fix that race condition,
but uncovered a separate one when switching canvases. This second race
condition behaved similarly to the first, where the enabling function
would be run before the disabling function. Adding a fallback enabling
function that triggers on loadstart seems to fix this second race
condition. There may still be some flakiness, especially on apple
devices, because events triggering properly sometimes just doesn't
happen.
@masaball masaball merged commit f2acb4d into develop Aug 19, 2024
2 checks passed
@masaball masaball deleted the btn_race_condition branch August 19, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants