Solved Shared IP tab does not have stable ordering resulting in unreliable matching across multiple users

This topic has been solved
X

Xon

Guest
\XF\Repository\Ip::getSharedIpUsers has an odd failure mode where shared ip tab for two users that should show each other do not reliably show each other on the shared IP list.

This is because of a lack of order by clauses in the two queries:

PHP:

Code:
$recentIps = $db->fetchAllColumn("
    SELECT DISTINCT ip
    FROM xf_ip
    WHERE user_id = ?
       AND log_date > ?
    LIMIT 500
", [$userId, $cutOff]);
This query has no explicit order clause, and with enough matches it is...

Read more

Continue reading...