Skip to content

Remove hardcoded restriction on non-admins closing discsussions with >50 pages#112

Open
Qwerfjkl wants to merge 2 commits intowikimedia-gadgets:masterfrom
Qwerfjkl:patch-1
Open

Remove hardcoded restriction on non-admins closing discsussions with >50 pages#112
Qwerfjkl wants to merge 2 commits intowikimedia-gadgets:masterfrom
Qwerfjkl:patch-1

Conversation

@Qwerfjkl
Copy link
Copy Markdown
Contributor

I've modified the test to behave identically to admin as well.

@NovemLinguae
Copy link
Copy Markdown
Member

Thanks. Will double check consensus at https://en.wikipedia.org/wiki/Wikipedia_talk:XFDcloser#Proposal_to_allow_non-admins_to_close_huge_XFDs_(%3E50_pages) . If no objections in a few days, happy to move forward.

I imagine XFDcloser already detects and handles non-admins, and changes its behavior appropriately (i.e. doing something besides deleting since non-admins can't delete). This would just increase the quantity of pages they could do it on.

@bunnypranav
Copy link
Copy Markdown
Contributor

@NovemLinguae seems to have no objections after 3 months, can this be moved forward? Have come across this many times while relisting/closing CfDs, so would be useful to have deployed :)

@NovemLinguae
Copy link
Copy Markdown
Member

What are the steps to test this one? I did the following and was able to close it as a non-admin even before applying this patch. So I think I am missing something.

  • git checkout master
  • npm start to build and start a localhost test server
  • log in as a non admin user (NovemBot)
  • on testwiki, add the localhost test server to my User:NovemBot/common.js file using:
var xfdcDevUrl = "http://localhost:8125/dist/loader-dev.js";
mw.loader.getScript(xfdcDevUrl).catch(function(e) {
    e.message += " " + xfdcDevUrl;
    console.error(e);
});

@bunnypranav
Copy link
Copy Markdown
Contributor

@NovemLinguae That is not the same result I am getting. Logged in using BunnysBot, a non-admin on testwiki, and got the Too many pages message for another CfD from Dec 12, see below:
image
I was able to replicate the same on enwiki with my main account; I later closed using Qwerfjkl's script for context.

@Qwerfjkl This PR seems to allow my non-admin account on testwiki to open the dialog to close the script, but something else stops me from actually closing the discussion, this may or may not be a problem from my end.

@bunnypranav
Copy link
Copy Markdown
Contributor

I was also able to close the Category:Kurdish Iranian people on Dec 19 without admin and from the master branch. Looks the page counting for the discussion might be a bit weird.

Copy link
Copy Markdown
Member

@NovemLinguae NovemLinguae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can ignore the previous bug I mentioned. Seems unrelated. I found a new bug in this patch though:

Steps to reproduce:

  • checkout your patch
  • npm start to build and start a localhost test server
  • log in as a non admin user (NovemBot)
  • on testwiki, add the localhost test server to my User:NovemBot/common.js file using:
var xfdcDevUrl = "http://localhost:8125/dist/loader-dev.js";
mw.loader.getScript(xfdcDevUrl).catch(function(e) {
    e.message += " " + xfdcDevUrl;
    console.error(e);
});

What happens?

  • Nothing. Silent error. User stuck on same screen without the CFD being closed.
  • JavaScript console error:
image

Please fix :)

@bunnypranav
Copy link
Copy Markdown
Contributor

bunnypranav commented Dec 25, 2025

(small note that I found this issue with the same discussion in my prior comment, although I did not document it clearly)

@siddharthvp
Copy link
Copy Markdown
Member

I think this should only be allowed if "No automated actions" is checked. As there are at least two automated actions per page (removing tag + adding {{old xfd}} to the talk page) and non-admins are subject to rate limits of 90/min, allowing it for large bundled XfDs will lead to botched closes with some edits failing.

@NovemLinguae
Copy link
Copy Markdown
Member

I think this should only be allowed if "No automated actions" is checked. As there are at least two automated actions per page (removing tag + adding {{old xfd}} to the talk page) and non-admins are subject to rate limits of 90/min, allowing it for large bundled XfDs will lead to botched closes with some edits failing.

Sounds reasonable. Can this patch be reworked to check if the user is a non-admin, and if so, remove / not show the "Remove nomination templates, tag talk pages" option in the dropdown? And perhaps also add a note outside the dropdown in red text that says "Can't remove nomination templates and tag talk pages. Too many actions for non-admin. Will hit the rate limit."?

Then after that, I can re-test and see if the bug in #112 (review) is still present.

@Qwerfjkl
Copy link
Copy Markdown
Contributor Author

Apologies for not responding here earlier.
Do you think it would be overly complex to handle ratelimiting? I suppose the CFD bot can probably handle removing the templates, but I don't think it would add {{old cfd}}.

@NovemLinguae
Copy link
Copy Markdown
Member

Come to think of it, we might have already added it in #87 . Do you think that patch of yours would handle what siddharthvp is concerned about?

@Qwerfjkl
Copy link
Copy Markdown
Contributor Author

No, that's for the 50 page limit; this is for the separate editing ratelimit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants