User talk:GeneralNotability/spihelper/Archives/2020/September

Tagging
Tags are currently added as

Could it be switched to the more verbose, but equivalent to make it easier to amend the tag manually later? There's no alteration to its appearance but will save looking up Template:Sockpuppet/doc to figure out how to tag a confirmed, locked & not blocked sock & other such oddities.

It would also be good, while I'm dwelling on it, to alter the template to also take named parameters rather than just numbered/positional parameters... -- Thanks, Cabayi (talk) 11:25, 1 September 2020 (UTC)
 * , but what about the cost of adding a few dozen bytes per sock tag? Imagine the server load! (Sounds reasonable and pretty straightforward, I'll work on it) GeneralNotability (talk) 14:14, 1 September 2020 (UTC)
 * I shall spare a moment of reflection to honour those extra pixels bravely giving their all for the greater good of the wiki. Thanks, Cabayi (talk) 17:53, 1 September 2020 (UTC)
 * , added in 2.2.3 along with a fix for the block reason for rangeblocks (it was saving an empty string as the block reason because I failed at parentheses). GeneralNotability (talk) 01:18, 2 September 2020 (UTC)


 * There is a bug here. When you supply an empty cat parameter, the account no longer gets categorized correctly, see . The empty cat parameter should be removed. Mz7 (talk) 05:03, 2 September 2020 (UTC)
 * Heh, a part of me wants to be conservative here and feels like this change overcomplicates the tagging a bit and makes it less understandable. We rarely change sock tags after we apply them, and most of the other parameters in the sockpuppet template beyond 1 and 2 are seldom used and rather obscure. If we must make this change at all, I would prefer the other version Cabayi suggested with just the "master" and "status" parameters. Mz7 (talk) 05:12, 2 September 2020 (UTC)
 * , acknowledged - I've removed a couple lines from my dev version and will sync them soon. GeneralNotability (talk) 12:33, 2 September 2020 (UTC)
 * Thanks, the locked = no & notblocked = no were the ones I really can see being adjusted manually (if rarely) and challenging my memory beyond its capacity. Cabayi (talk) 10:36, 3 September 2020 (UTC)

Double archiving?
could you take a look at the history of Sockpuppet investigations/Arshifakhan61/Archive. It's a multi-day case that I archived using spihelper.js. It looks like the script double-archived most of the sections. Thank you to for noticing the problem and fixing the archive page. -- RoySmith (talk) 17:46, 2 September 2020 (UTC)
 * , interesting, saw a similar problem (but since it was just bradv I figured it was his fault )...I'll have a look. GeneralNotability (talk) 17:48, 2 September 2020 (UTC)
 * Oh,, question - how did you do your archiving here, was it the one-click archive button? GeneralNotability (talk) 17:49, 2 September 2020 (UTC)
 * , one-click, yes. -- RoySmith (talk) 17:51, 2 September 2020 (UTC)
 * , okay, pushed a fix, I hope. GeneralNotability (talk) 17:58, 2 September 2020 (UTC)
 * , Thanks. I'll keep an eye open the next time I archive something. -- RoySmith (talk) 18:50, 2 September 2020 (UTC)
 * For reference - I think the trigger here is when a spihelper is archiving multiple sections in one case. I didn't mark the call that blanked the newly-archived section as "await," so I think that for large cases where multiple sections were archived, spihelper was re-reading the SPI page before the write had finished. GeneralNotability (talk) 19:57, 2 September 2020 (UTC)
 * , Yeah, nothing there's I than hate more multithreaded conditions race. -- RoySmith (talk) 20:38, 2 September 2020 (UTC)
 * "knock knock" "race condition!" "who's there?" GeneralNotability (talk) 20:43, 2 September 2020 (UTC)

sockpuppet template formatting?
Looking at this revision, the sockpuppet is broken across lines. Is that a new change to spihelper? I ask because that breaks the regex parsing I do in tag-check (obligatory whine about how regex is not a parser). -- RoySmith (talk) 13:09, 3 September 2020 (UTC)
 * , yup, see two sections up. If it's giving you problems I could condense everything back to one line. GeneralNotability (talk) 13:13, 3 September 2020 (UTC)
 * , Let me think on this a bit. Making things easier for humans is a good goal, so backing out your change would be a step backwards..  The fundamental problem here is that I'm parsing the wikitext with regexes, which is a losing game.  Is there anything like mwparserfromhell for javascript? -- RoySmith (talk) 13:18, 3 September 2020 (UTC)
 * , no idea, but could you do a multiline regex to match the template and then remove all the newlines? something like //im (non-greedy * there so that we don't run over into a different template). GeneralNotability (talk) 14:52, 3 September 2020 (UTC)
 * , yeah, I've been playing around in that direction. The latest hitch is how to ignore the "blocked/proven/confirmed" in the HTML comments, but that's going deeper and deeper into regex abuse territory.
 * I'm actually thinking the best thing I could do here is add a JSON call to my spi-tools server-side app and have that do the parsing using mwparserfromhell. I think I'm going to take you up on your offer to roll your change back temporarily, while I work on a good fix to my stuff. -- RoySmith (talk) 15:06, 3 September 2020 (UTC)
 * , if the HTML comment is the main issue I can remove that, no problem. GeneralNotability (talk) 15:45, 3 September 2020 (UTC)
 * , That would certainly simplify things, yes. -- RoySmith (talk) 15:46, 3 September 2020 (UTC)
 * Actually, I'm looking at wtf_wikipedia which looks like it should do what I need without you having to change anything. -- RoySmith (talk) 18:17, 3 September 2020 (UTC)
 * You can use the locally available MediaWiki:Gadget-libExtraUtil.js (parseTemplates function). But is there really a chance that the sockpuppet template can ever have nested templates in it? Because if not, using a formal parsing method is overkill and you're better off using a multiline regex. Note that  flag (not  ) in JS makes   match newlines. This flag is not supported in older browsers like IE 11. If you want to support those browsers as well, use   instead of  . –  SD0001  (talk) 19:47, 3 September 2020 (UTC)
 * , I originally used a regex because it was simple and easy, but down that path lies madness. It's not just the multiline issue; that's easy to solve.  Then it's ignoring HTML comments.  And dealing with inventive usernames, i.e. User:1=proven, and so on. -- RoySmith (talk) 20:49, 3 September 2020 (UTC)
 * I just uploaded a new version of tag-check which uses Parsoid instead of regex to parse the sock templates. The upside here is that what I've got now is a lot more robust.  I've also had the opportunity to learn something about Parsoid, which is clearly the way of the future, even if the API that's exposed is mind-bogglingly obtuse. -- RoySmith (talk) 00:20, 5 September 2020 (UTC)
 * I just uploaded a new version of tag-check which uses Parsoid instead of regex to parse the sock templates. The upside here is that what I've got now is a lot more robust.  I've also had the opportunity to learn something about Parsoid, which is clearly the way of the future, even if the API that's exposed is mind-bogglingly obtuse. -- RoySmith (talk) 00:20, 5 September 2020 (UTC)