wikimedia-gadgets / xfdcloser

Wikipedia gadget to close deletion discussions at XfD venues, including actions to implement closes
Other
2 stars 7 forks source link

headings sometimes incorrectly marked as closed on old skins (DiscussionTools race condition) #52

Closed NovemLinguae closed 5 months ago

NovemLinguae commented 5 months ago

Related #50 headings sometimes incorrectly marked as closed if User:Novem_Linguae/Scripts/VoteCounter.js is installed

I found a case of this that occurs even when VoteCounter isn't installed. Perhaps the multi nomination is to blame. Works in vector though. And I do not see a class on the next sibling.

Steps to reproduce

What happens?

image image

What should happen instead?

NovemLinguae commented 5 months ago

OK, this one's interesting. XFDcloser is in a race condition with DiscussionTools.

Before DiscussionTools loads, the HTML element after the heading doesn't have a class, so XFDcloser reads it as non-closed.

But after DiscussionTools loads, almost every HTML element on the page gets a class, so XFDcloser reads it as closed.

XFDcloser skips putting its links by headings it thinks are already closed.

Because of the race condition, XFDcloser gets one set of links placed (generally), but isn't able to place the rest of them.

NovemLinguae commented 5 months ago

Now that I wrote patch #56 for similar bug #54, I can no longer reproduce this. Maybe I misdiagnosed this one and it wasn't a DiscussionTools race condition after all. Closing for now.