Page MenuHomePhabricator

Investigate: IP info not shown when all IP's edits are deleted
Closed, ResolvedPublicBUG REPORT

Assigned To
Authored By
TheresNoTime
May 27 2022, 12:43 AM
Referenced Files
F35705706: image.png
Nov 4 2022, 10:11 AM
F35705704: image.png
Nov 4 2022, 10:11 AM
F35525816: image.png
Sep 20 2022, 11:18 AM
F35525814: image.png
Sep 20 2022, 11:18 AM
F35180641: image.png
May 27 2022, 12:43 AM

Description

When viewing the contribution page of 91.234.24.35, the message:

image.png (75Γ—686 px, 4 KB)

is displayed. This is due to all relevant edits by this IP having been deleted.

However, a log entry still exists, and manually calling the IP info API (https://en.wikipedia.org/w/rest.php/ipinfo/v0/log/131734402?dataContext=infobox) returns the data.

IP info should check for any relevant log entries

To investigate

In the case that an IP address only has deleted contributions:

  • If a user has permission to see deleted contributions, can they see IPInfo?
  • If a user does not have permission to see deleted contributions, can they see IPInfo?
  • If a user does not have permission to see deleted contributions, should they be able to see IPInfo?
  • Can we get the number of deleted edits?

Event Timeline

Since there will be some cases where no relevant log entries exist either, e.g. https://en.wikipedia.org/wiki/Special:Contributions/2803:D100:E080:306:787A:3962:E1E7:52EB, would there be any way to work from deleted contribs, at least for admins? Otherwise we have a situation where an LTA could cause a lot of disruption on a deletion-eligible page that someone else created, that page gets deleted, and now there's no way to use IP Info on the IP the LTA was using, short of undeleting a revision, which is something of a perverse incentive.

@Tchanders is it possible to enable IP Information to be shown based off of log entries and not edits? And also would it be possible to address the use case Tamzin brings up above?

Tchanders renamed this task from IP info not shown when all IP's edits are deleted to Investigate: IP info not shown when all IP's edits are deleted.Aug 1 2022, 5:40 PM
Tchanders updated the task description. (Show Details)

tl;dr:

Presuming the IP has no other revisions present on their Special:Contributions page,

  • If a user has permission to see the deleted contributions, they can see IPInfo about that IP
  • If a user does not have permission to see the deleted contributions, they cannot see IPInfo about that IP

tl;dr;tl;dr: If a user can see any revision, they can see IPInfo. If they can't, they can't.


Tested with the following scenario:

  1. Made an edit with an IP that has never contributed to the wiki otherwise
  2. Confirmed that the revision shows up on the Special:Contributions page for the IP
  3. Reverted the edit (so that it's no longer the current revision) and deleted the revision, hiding every piece of information about it but not from admins

Confirmed that:

  • The admin who deleted the revision can still see IPInfo from the Special:Contributions page
  • Another admin could view IPInfo from the Special:Contributions page
  • Calling the API directly successfully returned data from both users
  • The revision is not considered a revision on Special:DeletedContributions
  1. Hid the edit from other admins

Confirmed that:

  • The admin who deleted the revision can still see IPInfo from the Special:Contributions page
  • Another admin could not view IPInfo from the Special:Contributions page
  • Calling the API directly successfully returned data from both users

Testing with the scenario Tazmin has described:

  1. Create a page
  2. Edit the page from an IP
  3. Delete the page

Confirmed that:

  • No user could view IPInfo for the IP
  • Attempts to hit the API directly using the revision id failed
  • The revision can be seen from Special:DeletedContributions

@Prtksxna I think there are a few asks here:

  • It sounds like a bug that a user can't see the revision from the front-end (for whatever reason, they don't have access) but can access IPInfo for that revision through the API. Thoughts?
  • If a user does not have permission to see deleted contributions, should they be able to see IPInfo?
  • As Tazmin mentions, there's a Special:DeletedContributions page. Would we consider implementing IPInfo here?
    • The contributions mentioned here are not equivalent to the "deleted" (hidden) revisions that can be seen on Special:Contributions. Implementing IPInfo here would require additional work since it isn't set up to understand the concept of these revisions but the work seems very possible. It's more accurate to consider revisions on deleted pages as "archived" revisions, as they are stored in the archive table ("regular" and "deleted/hidden" revisions are stored in the revision table. Revisions have access to the class RevisionLookup which provides some of the common methods for accessing information about revisions. Archived revisions has an analogous class, ArchivedRevisionLookup which I believe we can use in a similar fashion.

Can we get the number of deleted edits?

From the table directly? Yes:

SELECT * FROM revision WHERE rev_deleted != 0 AND rev_actor = <id>;

afaik there's no function that would get this final count for us out of the box (but someone who knows more about this area of the code than I do, please correct me if I'm wrong!)

Confirming my understanding, there are two different forms of soft deletion:

  • Those that stay in the revisions table but are marked deleted
  • Those that are moved to the archive table

…and…

  • What shows up in DeletedContributions: Only stuff from pages that have been deleted (archived), but not suppressed edits.

Questions

hiding every piece of information about it but not from admins

Is this the same as suppression?

Hid the edit from other admins

How does one do that?

From the table directly? Yes

Would this be accessible only to those with permissions to see deleted edits? If there is no function does that mean that there are no such permissions at the moment?

Would we want people who don't know that a person has deleted edits, now know that they have deleted edits? Can they already? Is there a security question here?


It sounds like a bug that a user can't see the revision from the front-end (for whatever reason, they don't have access) but can access IPInfo for that revision through the API. Thoughts?

Definitely sounds like a bug at the moment. But the behavior we choose to implement might change that (make it accessible from both, or neither).

Confirming my understanding

Yes afaik this is correct.

Is this the same as suppression?
Hid the edit from other admins

Yes this is suppression and explicitly disallowing admins from viewing it as well:

image.png (281Γ—498 px, 27 KB)

Would this be accessible only to those with permissions to see deleted edits? If there is no function does that mean that there are no such permissions at the moment?

Yes. The same sort of permissioning applies. You can delete a page and suppress the edits at the same time:

image.png (341Γ—473 px, 21 KB)

You can query the deleted revisions if you know the page ID. If the revisions weren't suppressed, anyone can see the deleted revisions. If the revisions were suppressed at the time of page deletion, then the deleter can still see the owner of the revision but other users can't:

"deletedrevisions": [
    {
        "revid": 328,
        "parentid": 327,
        "userhidden": "",
        "user": "185.248.173.136",
        "anon": "",
        "timestamp": "2022-09-20T10:36:59Z",
        "commenthidden": "",
        "comment": "",
        "suppressed": ""
    },

vs

"deletedrevisions": [
    {
        "revid": 328,
        "parentid": 327,
        "userhidden": "",
        "timestamp": "2022-09-20T10:36:59Z",
        "commenthidden": "",
        "suppressed": ""
    },

Would we want people who don't know that a person has deleted edits, now know that they have deleted edits? Can they already? Is there a security question here?

fwiw if we follow the functionality now, we wouldn't be exposing any additional information. All of this would have to be revealed on the Special:DeletedContributions page, so it can fall back to checking for a revision that the user has access to know exists.

Definitely sounds like a bug at the moment. But the behavior we choose to implement might change that (make it accessible from both, or neither).

I think the decision is yours. In my opinion, it's a bug that IPInfo is aware that the revision exists even though the user shouldn't seem to have access to it.

In my opinion, it's a bug that IPInfo is aware that the revision exists even though the user shouldn't seem to have access to it.

I understand. Filing this here T318462: IP Info shouldn't be aware of revision if user doesn't have access to it.

All of this would have to be revealed on the Special:DeletedContributions page, so it can fall back to checking for a revision that the user has access to know exists.

I think we should definitely note this as a feature request. Will have at adjust priority based on roadmap. Noting it here T318463: IP Info accordion should show up on the Special:DeletedContributions, please feel free to add technical details.

Yes. The same sort of permissioning applies.

So from this I understand that we should be able to show a number of deleted edits in the accordion for those who have access to this data. I've created T318464: IP Info accordion should show count of deleted edits to those who have access. Let me know if I should add something here.

I'm lost on this one now - ipinfo is NOT showing when all edits are deleted, even if the person using it has access to the deleted contributions - is this expected now?

I'm lost on this one now - ipinfo is NOT showing when all edits are deleted, even if the person using it has access to the deleted contributions - is this expected now?

As far as I understand, no behavior was updated as part of this ticket. Have you com across a change?

No, came looking for a ticket of why ipinfo didn't work when edits were deleted and saw this ticket. See this was an "investigate" request - is the conclusion that ipinfo should not work if edits are deleted by design?

Per Tran's investigation IP info is visible to those who can see the deleted edits.

Presuming the IP has no other revisions present on their Special:Contributions page,

  • If a user has permission to see the deleted contributions, they can see IPInfo about that IP
  • If a user does not have permission to see the deleted contributions, they cannot see IPInfo about that IP

To clarify are you referring to:

  1. Being able to see IP info for IPs whose deleted edits you don't have access to?
  2. Being able to see IP info for archived edits, that is, those edits of pages that have been deleted? (see T318463)

Here is what I'm seeing in production on metawiki. Page: https://meta.wikimedia.org/wiki/Special:Contributions/111.119.178.158

NO IP INFO:

image.png (392Γ—746 px, 36 KB)

RECENT DELETED EDITS:

image.png (434Γ—1 px, 46 KB)

Should IP INFO be showing there, and a bug is occurring - or is it not expected to work there?

Closed-->IP as the last result doesn't appear to match the prior assumtion

I think I worded that incorrectly. There are suppressed edits and deleted edits. If the user has the ability to see a suppressed edit, they can use IP Info on Special:Contributions (T318462: IP Info shouldn't be aware of revision if user doesn't have access to it). Deleted edits are migrated to a different table and support for it is tracked by T318463: IP Info accordion should show up on the Special:DeletedContributions. There's also work being done to surface deleted contributions for Special:Contributions being tracked by T318464: IP Info accordion should show count of deleted edits to those who have access.

Closing this again since afaik, tickets have all been created and are in progress.