Page MenuHomePhabricator

Unregistered users can be thanked via the API
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
API succeeds and a log entry is generated (example) although unregistered users can't be notified about the thanks.

What should have happened instead?:
API should fail with a notice that unregistered users can't be thanked

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Was originally reported at https://meta.wikimedia.org/wiki/Talk:SWViewer#[BUG]:_Remove_the_ability_to_thank_IP_Users

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Thanks, I was thinking whether or not to create a phab for this.

Go to https://test.wikipedia.org/wiki/Special:APISandbox

Just FYI: Since the test Wikipedia has Temporary accounts enabled, and you can actually thank temporary accounts (that's a built-in feature), as opposed to IP users, it might not be the best place to test this bug.

Daimona raised the priority of this task from Low to Needs Triage.Oct 12 2025, 12:27 AM
Daimona added a subscriber: matej_suchanek.

I think this is an oversight that stems from the unfortunate state of the codebase where thanks "eligibility" checks are done by each interface separately. Hence, if a new check is to be added (such as T407056), it needs to be duplicated everywhere where the eligibility for thanking (definitive or tentative) is checked.

In particular, some checks are run in Hooks::insertThankLink, Hooks::onLogEventsListLineEnding, ApiThank, ApiCoreThank, LogStore::getLogEntryFromId, and even LogStore::thank (where it's actually too late). Some of them do share code, but the logic is duplicated nevertheless.

It would be nice to come up with an interface that would encapsulate all (most of) the checks, differentiate between tentative ("quick", batch checks for interface) and definitive ("expensive", for authorization) ones, and satisfy both the user interface, where a mere boolean is expected, and the API, where different error states are presented (perhaps using Status?).