fix(404Anime): read presence data from the DOM instead of an async bridge#11031
Open
sankeer28 wants to merge 5 commits into
Open
fix(404Anime): read presence data from the DOM instead of an async bridge#11031sankeer28 wants to merge 5 commits into
sankeer28 wants to merge 5 commits into
Conversation
UpdateData awaited execInPage/getPageVariable on every tick, which fires more often than that round trip completes. Calls backed up and the extension logged 'UpdateData execution is too slow' while skipping most updates, so Discord activity never refreshed for real users. Poll the bridge on our own 1s interval instead and have UpdateData read the cached result synchronously.
Contributor
🖼️ Activity asset previewAnother day, another diff. Here's everything shiny I could dig out of this one. 404Anime (
|
| Preview | Source | URL |
|---|---|---|
![]() |
logo | https://cdn.rcd.gg/PreMiD/websites/0-9/404Anime/assets/logo.png |
| thumbnail | https://cdn.rcd.gg/PreMiD/websites/0-9/404Anime/assets/thumbnail.png |
Beep boop — I refresh this comment on every push, so no need to scroll. 🤖
…idge The previous fix (poll + cache) worked around execInPage's round-trip latency without removing it. Every other activity in this repo reads its data straight from the page's DOM, which is synchronous — no cross-realm message-passing needed. Switch to that pattern: the site now renders a hidden #s-anime-premid element with the presence data as data-* attributes, and UpdateData reads it directly with no async call at all, removing the "UpdateData execution is too slow" risk entirely instead of just reducing how often it's hit.
skullysmods
approved these changes
Jul 24, 2026
skullysmods
enabled auto-merge (squash)
July 24, 2026 08:48
Bas950
reviewed
Jul 24, 2026
Bas950
left a comment
Member
There was a problem hiding this comment.
Honestly the async one is probably better but it should be cached so it doesnt keep requesting it if there are no changes.
auto-merge was automatically disabled
July 24, 2026 21:10
Head branch was pushed to by a user without write access
Contributor
Author
|
Added some caching |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What was wrong
Discord's status was never updating for people watching on 404Anime.
UpdateDataawaited an async bridge read (execInPage/getPageVariable) on every tick to get the page's presence data.UpdateDatafires far more often than that round trip can finish, so calls piled up and the extension loggedUpdateData execution is too slow! Skipped N updates, skipping most updates.The fix
Read the data from a hidden DOM element the site renders instead of an async bridge call. This matches how every other activity in this repo reads its data. It's synchronous, so
UpdateDatanever awaits anything and can't fall behind.Acknowledgements
npx eslint "websites/0-9/404Anime" --cacheTested and works