Skip to content

Users with the same number of followers as another user sometimes disappear from the ranking #13

@dtolnay

Description

@dtolnay

I have observed multiple times that users temporarily disappear from the site, when they should be meeting the cutoffs for followers and contributions. For example this recently affected my account in a23a538. Right now, I appear on https://committers.top/united_states_public, but incorrectly do not appear on https://committers.top/worldwide_public. Other users who have fewer followers and fewer contributions than me appear on that page, which should not be possible.

From examining the code, I have found one bug that could cause this behavior.

In this function:

func (client HTTPGithubClient) SearchUsers(query UserSearchQuery) (GithubSearchResults, error) {

we perform queries for followers:<N where N is the minimum follower count observed so far. After getting back each page of results, the minFollowerCount is appropriately updated. However if an error occurs during any request and continue Pages is executed, there may still be users with follower count equal to minFollowerCount who have not yet been returned.

For example if the first query returns users with follower count 900, 890, 889, 889, 887 then minFollowerCount is set to 887. Ordinarily the next request would visit the second page of the same query, using GitHub's after: pagination, and may include additional users with an 887 follower count. However if an error occurs during the second request, after a retry the next query will execute with followers:<887 and any other users with follower count equal to 887 will have been lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions