x/pkgsite: inconsistent imported by numbers #39138
What is the URL of the page with the issue?
What is your user agent?
Google Chrome Version 81.0.4044.138 (Official Build) (64-bit)
What did you do?
Searched for "mux" in pkg.go.dev
What did you expect to see?
Expected Imported by numbers in the search result and in the package page to be the same
What did you see instead?
Different Imported by numbers for the same package - 9381 vs 12162
The text was updated successfully, but these errors were encountered:
At the moment, the imported by count on the main unit page and search page can differ on small values, where an exact count is shown. Since we fetch search_documents.num_imported_by on every GetUnit request, use that value consistently across the site. For golang/go#39138 Change-Id: I61b60029626dc8ab6353886f38a6f158841147bb Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288767 Trust: Julie Qiu <email@example.com> Run-TryBot: Julie Qiu <firstname.lastname@example.org> TryBot-Result: kokoro <email@example.com> Reviewed-by: Jonathan Amsterdam <firstname.lastname@example.org>
When loading the imported by page, fetch the imported by count from search_documents.num_imported_by, instead of limiting at 20,000. This will use the same logic for the imported by count with the main page and search page. For golang/go#39138 Change-Id: Iae188d01129b6e35cfd82b79e51a0ef12938c459 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/288849 Trust: Julie Qiu <email@example.com> Run-TryBot: Julie Qiu <firstname.lastname@example.org> TryBot-Result: kokoro <email@example.com> Reviewed-by: Jonathan Amsterdam <firstname.lastname@example.org>