MW-Peachy / Peachy

The official MediaWiki PHP bot framework. Current Version: 2.0 alpha 8
GNU General Public License v3.0
26 stars 21 forks source link

Stop using `action=tokens` API function. #120

Open Pchelolo opened 3 years ago

Pchelolo commented 3 years ago

MediaWiki Core team is going to remove the deprecated action=tokens API from core, thus also removing it from Wikimedia cluster. The API has been deprecated since 2014 and now it's blocking some major refactoring we are trying to make. Currently this library accounts for 78% of requests to the deprecated API, could you please update it use the meta=tokens replacement?

DannyS712 commented 3 years ago

@Pchelolo (and @cyberpower678) this was noticed a while ago and I sent a pull request to fix it last year, but only within the Cyberbot_I repo - is it also an issue in this repo? See https://github.com/cyberpower678/Cyberbot_I/pull/20

Pchelolo commented 3 years ago

Judging by the api-feature-usage logs in prod, Cyberbot_I seems to be using this library. Plus, some other bots use this library account for 83% of requests to deprecated endpoint.

reedy commented 3 years ago

It's not just action=tokens

action=query&list=users&ustoken seems to be used by numerous bots too - https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/Wiki.php#L2333

reedy commented 3 years ago

Bots are seemingly doing queries for ALL OF THE TOKENS

/w/api.php?action=tokens&type=block%7Cdelete%7Cdeleteglobalaccount%7Cedit%7Cemail%7Cimport%7Cmove%7Coptions%7Cpatrol%7Cprotect%7Csetglobalaccountstatus%7Cunblock%7Cwatch

https://github.com/MW-Peachy/Peachy/blob/2cd3f93fd48e06c8a9f9eaaf17c5547947f9613c/Includes/Wiki.php#L2315-L2320