XKit-Rewritten icon indicating copy to clipboard operation
XKit-Rewritten copied to clipboard

Tag Tracking+: tags with "quotes" or punctuation may not clear their counts

Open marcustyphoon opened this issue 2 years ago • 2 comments

Platform

Windows 10

Browser

Chrome 111.0.5563.65

Addon version

master

Details

Oh, fun. This explodes nicely if you follow a tag "surrounded in quotes", as:

  1. Tumblr views these as valid, but appears to deduplicate them and shows posts tagged with the unquoted version on the tagged page; to make this work perfectly I guess we need to be able to do an identical transformation or be smarter about rejecting junk in the API response; this won't work:
if (tags.every(tag => tag.toLowerCase() !== currentTag.toLowerCase())) {
  continue;
}

Originally posted by @marcustyphoon in https://github.com/AprilSylph/XKit-Rewritten/issues/850#issuecomment-1457506044

marcustyphoon avatar Mar 15 '23 20:03 marcustyphoon

A slightly-more-likely place for this to come up is in tags with an & between two names, which will show both posts with the actual tag and posts with the names separated by a space.

I feel like if I were very smart I would be like "oh obviously the tags are being normalized with [industry standard algorithm often use in, like, sql databases or something goes here]," but I'm not familiar with anything like that and it's serverside so I can't find it in the frontend code.

edit: In fact, the idea of finding out precisely what deterministic algorithm is being used is almost certainly a pointless one; actual testing has shown that it's not deterministic. Perhaps the behavior differs between recently or infrequently used tags (as that's what I was testing with) and others, but who knows.

marcustyphoon avatar Jun 22 '25 21:06 marcustyphoon

Interestingly, 40933986eb3b1935d1a0b130433966ba74386505 seems to have resulted in us losing the "filter only posts with the actual tag" when we do the API fetch, while we still have one when processing the page. If we had the same filter on both, tags like this would not get stuck with an unread count; they would instead not show an unread count some of the time when there actually were new posts. So, still broken, but in a less noticeable way.

marcustyphoon avatar Jun 22 '25 22:06 marcustyphoon