Page MenuHomePhabricator

The target filter on Special:Investigate should be more fuzzy [medium]
Closed, ResolvedPublic2 Estimated Story PointsMar 25 2020

Description

Problem
A target filter was added in T238809. However this filter only filters out targets that match exactly. This isn't ideal because a user most likely wants to exclude a specific user, IP, or range, from the result set that does not match the initially supplied targets.

Solution
Add the exclusions to the subqueries so the filter isn't as direct.

Event Timeline

ARamirez_WMF renamed this task from The target filter on Special:Investigate should be more fuzzy to The target filter on Special:Investigate should be more fuzzy [medium].Mar 12 2020, 6:34 PM
ARamirez_WMF raised the priority of this task from Medium to Needs Triage.
ARamirez_WMF set the point value for this task to 2.
ARamirez_WMF changed the subtype of this task from "Task" to "Deadline".
ARamirez_WMF changed Due Date from Mar 26 2020, 4:00 AM to Mar 25 2020, 4:00 AM.

@Niharika If a user wanted to filter out a range within a range, it would be more efficient (in terms of query performance) for them to add the two ranges left over as separate targets instead. Do you think we could disallow filtering out ranges?

Change 582796 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/CheckUser@master] Strengthen filter for Compare investigation on Special:Investigate

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

@Niharika If a user wanted to filter out a range within a range, it would be more efficient (in terms of query performance) for them to add the two ranges left over as separate targets instead. Do you think we could disallow filtering out ranges?

We could do that. Actually I think the current design does not account for filtering out ranges anyway. We were only thinking of filtering out specific IPs or users.
If we were to disallow it, would it just need a validation on the filter inputs?

If we were to disallow it, would it just need a validation on the filter inputs?

Yes - just a config change in the users multiselect widget.

Change 582796 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] Strengthen filter for Compare investigation on Special:Investigate

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

dom_walden subscribed.

When you filter out a username or IP (cannot filter out ranges), it gets added to each subquery as a NOT condition.

E.g., for an investigation for user=5 and IP range 1.2.0.0/16, if I filter out user's 14 and 16 and IPs 1.2.3.5 and 1.2.3.6:

SELECT a.cuc_user,a.cuc_user_text,a.cuc_ip,a.cuc_ip_hex,a.cuc_agent,MIN(a.cuc_timestamp) AS first_edit,MAX(a.cuc_timestamp) AS last_edit,count(*) AS total_edits
FROM ((SELECT cuc_id,cuc_user,cuc_user_text,cuc_ip,cuc_ip_hex,cuc_agent,cuc_timestamp FROM cu_changes WHERE cuc_user = 5 AND (cuc_ip_hex NOT IN ('01020305','01020306')) AND (cuc_user NOT IN (14,16)) AND cuc_type IN (0,1) ORDER BY cuc_timestamp DESC LIMIT 50000 )
UNION (SELECT cuc_id,cuc_user,cuc_user_text,cuc_ip,cuc_ip_hex,cuc_agent,cuc_timestamp FROM cu_changes WHERE ((cuc_ip_hex >= '01020000') AND (cuc_ip_hex <='0102FFFF')) AND (cuc_ip_hex NOT IN ('01020305','01020306')) AND (cuc_user NOT IN (14,16)) AND cuc_type IN (0,1) ORDER BY cuc_timestamp DESC LIMIT 50000 )) a
GROUP BY cuc_user_text,cuc_ip,cuc_agent ORDER BY cuc_user_text,cuc_ip,cuc_agent LIMIT 1001;

The final results have no mention of those users and IPs.