Repository navigation
Trending: read the 30-day install numbers for every plugin - #609
Merged
Merged
Conversation
The function behind the numbers returns a row for every active plugin, and the production Data API returns 100 rows per request. The site read it in one request, so only the first 100 plugins had numbers. On the live site 2 of 10,390 plugins had a 30-day count, and Trending ranked everything else by its estimate from lifetime installs. The query now asks only for the plugins that have installs in the window and reads them a page at a time, the way the plugin list is read. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Trending tab has not been ranking by recent installs. On the live site only 2 of 10,390 plugins have a 30-day install count. Trending shows those two first and ranks everything else by its estimate from lifetime installs, which is close to the Top tab.
Cause: the database function behind the numbers returns a row for every active plugin, and the production Data API returns 100 rows per request. The site read the function in one request, so it only ever saw the first 100 plugins.
Fix: ask only for the plugins that have installs in the window, in a fixed order, and read them a page at a time. The plugin list is already read this way.
Things to know
Testing
bunx biome ci .andbun run typecheckinapps/cursorpass.