Page MenuHomePhabricator

[Epic] Display temporary account contributions on Special:Contributions for IP addresses and IP ranges
Open, Needs TriagePublic

Description

Before making a potentially impactful IP block (especially when an IP range is involved), it is a common practice to review (logged out) contributions from those addresses. Once temporary accounts are deployed, this workflow will no longer work, as Special:Contributions will only allow users to display contributions from a temporary account, not from an IP address or similar. This means that for a collateral damage check to be done, a CheckUser would need to be consulted. This is already the case for hard IP blocks (which affect logged in editors), but enabling temporary accounts would widen that even to soft IP blocks.

This issue can be resolved by making Special:Contributions take an IP address or an IP range as a valid input. Upon submitting, it would display all (unregistered) contributions from that IP address or that IP range, which is the same as the current behavior. With this feature, administrators would continue to be able to do collateral damage checks across temporary accounts, if needed.

Special:Contributions should only show temporary account contributions for IP addresses/IP ranges if the currently logged-in user has sufficient permissions. What permissions would be necessary for this level of access is not yet clear, and should be set by future discussion. It likely doesn't need to be the same threshold as we currently have for Reveal IP (see policy), and it might be more strict. Personally, I think sysop and above would be a reasonable restriction.

In short: The task calls for queries such as https://cs.wikipedia.org/wiki/Speci%C3%A1ln%C3%AD:P%C5%99%C3%ADsp%C4%9Bvky/2001:718::/32 to continue working (just across temporary accounts), assuming the user has sufficient privileges.

This task is likely similar to (or a duplicate of) T356290: Return local contributions by temporary accounts given an IP address or range.

This proposal was discussed with @SCherukuwada prior to filling the task.

Related Objects

Event Timeline

We discussed doing this on another task: T356290: Return local contributions by temporary accounts given an IP address or range.

The dilemma was whether to show local contributions from temporary accounts, given an IP address/range on the GUC-like tool we build (which would no longer be called "Global user contributions"), or from Special:Contributions.

I made some comments about technical challenges here: T356290#9565086, and @KColeman-WMF commented on the design here: T356290#9588488. (I'm linking out rather than quoting so we can keep the discussion on the other task, rather than across two tasks.)

Tchanders renamed this task from Temporary accounts: Make Special:Contributions accept IP addresses and IP ranges as valid input to [Epic] Temporary accounts: Make Special:Contributions accept IP addresses and IP ranges as valid input.Mar 27 2024, 6:01 PM

Special:Contributions should only accept IP addresses/IP ranges if the currently logged-in user has sufficient permissions.

In our discussions, we've been assuming that Special:Contributions will still show historical contributions for IP addresses and ranges from before temporary accounts were enabled.

Special:Contributions should only accept IP addresses/IP ranges if the currently logged-in user has sufficient permissions.

In our discussions, we've been assuming that Special:Contributions will still show historical contributions for IP addresses and ranges from before temporary accounts were enabled.

Yes, it should.

Tchanders renamed this task from [Epic] Temporary accounts: Make Special:Contributions accept IP addresses and IP ranges as valid input to [Epic] Display temporary account contributions on Special:Contributions for IP addresses and IP ranges.Mar 27 2024, 6:09 PM
Tchanders updated the task description. (Show Details)

Thanks @JJMC89 - description updated.

Change #1015098 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/CheckUser@master] WIP POC Showing temp account edits on Special:Contributions/ip

https://gerrit.wikimedia.org/r/1015098

Do we need this for Special:DeletedContributions too?

Do we need this for Special:DeletedContributions too?

Yes please.

Do we need this for Special:DeletedContributions too?

Yes please.

+1 and ideally we would finally get the option to search for deleted contributions of IP-Ranges too (T183457)

Do we need this for Special:DeletedContributions too?

Yes please.

+1 and ideally we would finally get the option to search for deleted contributions of IP-Ranges too (T183457)

I think we can do this for temp accounts - so enter an IP address and see deleted contributions from the temp accounts from that IP.

The database structure makes this more difficult for historical IP contributions though, so that might not be possible as part of this change. (The ip_changes row gets deleted when the revision is deleted.)

While figuring out the technical details for displaying temp account contributions for an IP range on Special:Contributions, we came across some pretty ugly problems, leading me to propose a slightly different approach:

I'll summarize my thoughts following a discussion with @Dreamy_Jazz. (See also the code review discussion on https://gerrit.wikimedia.org/r/1019102.)

Technical considerations

Handling the ContribsPager__reallyDoQuery hook is quite bad. It's better (arguably even necessary) to implement a separate pager for finding contributions from different tables, given how pagers are implemented (with model, view and query all closely bound, and expecting results from one table). We've observed from the example of Flow hooking into ContribsPager that we get problems if we don't do this (for example T196227, T123336, T120567, plus various closed tasks that added hacks to try to make it work, e.g. T167577, T247919). I'd prefer to walk us away from this rather than deeper into it.

Having many separate special pages that do a similar thing is also not great (though in my opinion not as bad as the above, at least technically). Special:Contributions, Special:DeletedContributions and Special:IPContributions would have a lot in common: similar forms, similar data displayed for each row. The fact that Special:Contributions and Special:DeletedContributions have very separate implementations causes tech debt like T36524 and T357231. This is made even more complicated by the fact that Special:Contributions already sort of has two modes: single user vs IP range (in which case it queries the ip_changes table). Adding Special:IPContributions (and later Special:GlobalUserContributions - T337089) could risk further duplication and tech debt if not done carefully. However, we could take this opportunity to abstract out what we need for the other contributions-like pages from Special:Contributions and ContribsPager.

User experience considerations

The problem with having different special pages for contributions is that it makes it more difficult for the user. Although linking to Special:IPContributions from the revealed IP should make it easy to get to Special:IPContributions (see https://gerrit.wikimedia.org/r/1020820 and the screenshot below), there's a concern that users who were just browsing Special:Contributions wouldn't know to to look for Special:IPContributions if they saw nothing of interest on Special:Contributions.

image.png (158×898 px, 70 KB)

We discussed having Special:Contributions able to handle different modes, which extensions could add via hooks.

It could be really interesting to work on a Special:Contributions page that could do everything, but I think that would require product/design input which could add months onto this project (which is considered a blocker to temp accounts deployment). I wonder if instead we could get ourselves closer to that goal by cleaning up Special:Contributions and ensuring that Special:IPContributions and Special:GlobalUserContributions are consistent with it, and making sure that all the pages are discoverable from each other.

My proposal

  • Make Special:IPContributions, and link to it from the revealed IP address
  • Make AbstractContributionsSpecialPage and AbstractContribsPager to be used by SpecialContributions and SpecialIPContributions. (Later, SpecialDeletedContributions could use it, but that's beyond the scope here.)
  • Add link to Special:IPContributions from Special:Contributions/<ip> and Special:DeletedContributions/<ip>
    • This could temporarily be something more attention grabbing like a banner, when temp accounts are first enabled
  • Implement a 'deleted' mode within SpecialIPContributions that would join on the archive table. Modes could later be upstreamed to SpecialContributions itself (beyond the scope here).

We currently have:

ContributionDeleted Contribution
IP addressSpecial:ContributionsSpecial:DeletedContributions
IP rangeSpecial:ContributionsN/A
Temp accounts from an IP addressN/AN/A
Temp accounts from an IP rangeN/AN/A

If we do this proposal, we'd have:

ContributionDeleted Contribution
IP addressSpecial:ContributionsSpecial:DeletedContributions
IP rangeSpecial:ContributionsN/A
Temp accounts from an IP addressSpecial:IPContributions (normal mode)Special:IPContributions (deleted mode)
Temp accounts from an IP rangeSpecial:IPContributions (normal mode)Special:IPContributions (deleted mode)

Paving the way for something like:

ContributionDeleted Contribution
IP addressSpecial:Contributions (normal mode)Special:Contributions (deleted mode)
IP rangeSpecial:Contributions (normal mode)Special:Contributions (deleted mode)
Temp accounts from an IP addressSpecial:Contributions (patroller mode)Special:Contributions (patroller deleted mode)
Temp accounts from an IP rangeSpecial:Contributions (patroller mode)Special:Contributions (patroller deleted mode)