Topic: Possible bug in blacklist?

Posted under General

So I just wasted 30 minutes trying to figure out why certain blacklist changes refused to stick.

Let's say I open three images in a row 1, 2, 3. All 3 tabs are open at the same time. I go to image 1 and blacklist tag 1 using the little eyeball that pops up next to tags on the left side of the screen. The blacklist updates and image 1 is blocked. Then I go to image 2 in tab 2. I blacklist tag 2 there, and the blacklist updates. But suddenly, tag 1 is no longer blacklisted and image 1 is visible again. If I go to image 3 and blacklist tag 3, then suddenly image 2 is also visible again, you get the pattern.

It turns out that if I add to my blacklist using that little eyeball on a page that hasn't been refreshed since a change was made in another tab, the changes to my blacklist will be undone and replaced with the change from the 'stale' tab.

Is it supposed to work like that? I would assume that blacklisting tags would just add a new item to the bottom of the master list, not keep a unique list in every tab. If that's not a bug then it feels like it should be.

Donovan DMC

Former Staff

Each tab gets a copy of your blacklist on page load, they use that list and append to it when modifying your blacklist

This isn't really a bug, it's just how it has to work to avoid having to fetch your entire user each time your blacklist is updated

It would make the coding a little more complex, but I've been playing around with Broadcast Channels lately in JavaScript and they could provide a possible solution to this without needing to fetch the list again. Each time the blacklist is updated, the changes could be broadcast to the other tabs using the aforementioned broadcast channels, and those channels can then apply the same changes to their in-memory copies of the blacklist.

Donovan DMC

Former Staff

kyureki said:
It would make the coding a little more complex, but I've been playing around with Broadcast Channels lately in JavaScript and they could provide a possible solution to this without needing to fetch the list again. Each time the blacklist is updated, the changes could be broadcast to the other tabs using the aforementioned broadcast channels, and those channels can then apply the same changes to their in-memory copies of the blacklist.

That sounds like a lot of work for minimal payoff

Aacafah

Moderator

kyureki said:
It would make the coding a little more complex, but I've been playing around with Broadcast Channels lately in JavaScript and they could provide a possible solution to this without needing to fetch the list again. Each time the blacklist is updated, the changes could be broadcast to the other tabs using the aforementioned broadcast channels, and those channels can then apply the same changes to their in-memory copies of the blacklist.

That's really cool; I hadn't heard about this!

...I mean I ain't adding it to handle this, but in all seriousness, this is genuinely interesting; I'll be looking through this later.

trivmph said:
Is it supposed to work like that?

No, but this is an edge case; the to-do list already wraps halfway around the world, & I really don't find handling this edge case valuable enough to extend it any further.

Adding such features also feeds the Lines of Code monkeys at Google and Mozilla. XD

Original page: https://e621.net/forum_topics/59469