feat(Tag Tracking+): Reduce API load when multiple Tumblr tabs are open - #2375
Draft
marcustyphoon wants to merge 4 commits into
Draft
marcustyphoon wants to merge 4 commits into
marcustyphoon wants to merge 4 commits into
Conversation
marcustyphoon
force-pushed
the
marcustyphoon/tag-tracking-deduplicate-storage-dev-11
branch
from
September 4, 2026 23:41
3e8144e to
0ea81b2
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This was
linked to
issues
Sep 8, 2026
marcustyphoon
force-pushed
the
marcustyphoon/tag-tracking-deduplicate-storage-dev-11
branch
from
September 9, 2026 01:23
0ea81b2 to
c33a62b
Compare
marcustyphoon
force-pushed
the
marcustyphoon/tag-tracking-deduplicate-storage-dev-11
branch
from
September 9, 2026 01:29
c33a62b to
251e09a
Compare
marcustyphoon
force-pushed
the
marcustyphoon/tag-tracking-deduplicate-storage-dev-11
branch
from
September 9, 2026 09:13
251e09a to
d9221f6
Compare
Collaborator
Author
|
master...AprilSylph:XKit-Rewritten:marcustyphoon/tag-tracking-deduplicate-storage-dev-13 Hm, maybe pure-storage is actually better? edit: Aw. I briefly got excited that even without a background script, we could use session storage in content scripts on a progressive enhancement basis by calling |
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.
Description
I think this is my first version of #1813 that I'm not aware of any bugs in.
This is a full(?) version of what I hoped to do to Tag Tracking+: an implementation which:
General description of the implementation:
...and a sidebar never goes back todata-loaded=false; besides this, all tabs' sidebars are rendered using the same data (updateSidebardepends only on storage and is called only inonStorageChanged).main; if any tags need initial load, they're loaded in order by the refreshing tab at up to 2/sec.*Not tested, but I think conceptually the e.g. "six Firefox container tabs logged into three accounts with different tracked tag lists" scenario should work correctly (at up to 3x API load vs a single tab, depending on tracked tag count and overlap). Tabs with the same tracked tag list should elect a single tab that's allowed to refresh.
Note: I don't love the errored-tag behavior here, but I'm not sure what the ideal behavior actually is. The main problem when deciding that is that in practice the main way I see the鈿狅笍 appear is when interrupting a fetch by closing a tab/putting the computer to sleep/disconnecting from the internet (probably shouldn't sync that to other tabs at all, and if one does, the tab should probably immediately retry the errored tag), but that doesn't necessarily demand the same behavior as "something is wrong with fetching this tag specifically" (in which case one should probably only reattempt it as part of the cycle... or at minimum shouldn't spam attempts every half a second at the expense of all other tags).
Draft because of that, because console.info() calls are not removed currently, and because maybe I can still think of a solution with fewer lines of code.
edit: Oh, and reminder to myself to consider using
document.hasFocus()in some way. Also, potentially always run a 500ms loop and do nothing if the count mod 60 (or whatever) isn't zero in background-refresh mode, as this is more flexible.Screenshots
n/a (I could take a video of side by side tabs with devtools open, I suppose, but that would be a lot of work)
Testing steps
tba