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

Use plain old javascript to get de-duplication of listener registration #5775

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

cjcolvar
Copy link
Member

Before this change setInterval(enableCreateThumbnail) would register the show and update handlers hundreds of times (depending on how long the page had been loaded) leading to the same large number of requests to fetch the poster image or post the update. This PR uses addEventListener which de-duplicates listeners when registered with a function.

Related to #5743

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.

👍

@cjcolvar cjcolvar merged commit 3fdf6b0 into develop Apr 10, 2024
2 checks passed
@cjcolvar cjcolvar deleted the many_ears_to_one branch April 10, 2024 19:48
@joncameron joncameron mentioned this pull request Apr 12, 2024
27 tasks
@cjcolvar cjcolvar mentioned this pull request Apr 12, 2024
@elynema
Copy link
Contributor

elynema commented Apr 15, 2024

compared network tab in dev tools on demo site and avalon-staging. On demo site, there were many calls to POST https://demo.avalonmediasystem.org/master_files/pc289j26r/still and then to GET the media https://demo.avalonmediasystem.org/media_objects/vd66w013p.

On avalon-staging, I only see one of each when I create a thumbnail in both Chrome and Safari, so this looks good to me.

@joncameron joncameron mentioned this pull request Jul 8, 2024
25 tasks
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