Fix analytics page crashes for large star counts#7
Open
natea wants to merge 3 commits intoadambkovacs:mainfrom
Open
Fix analytics page crashes for large star counts#7natea wants to merge 3 commits intoadambkovacs:mainfrom
natea wants to merge 3 commits intoadambkovacs:mainfrom
Conversation
Remove the case-insensitive fallback that called .collect() on the entire repoCatalog table. During first import, every repo triggered this fallback since no existing match was found, causing O(n²) document reads that exceeded Convex's 32k limit around ~600 repos. The indexed lookup via by_fullName is sufficient — GitHub returns consistently-cased fullName values. Fixes adambkovacs#3 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace N+1 db.get() join patterns with efficient alternatives: - listUserRepoStates: denormalize repoFullName onto userRepoStates to eliminate joins entirely (with fallback for existing rows) - listPortfolioEvents: single repoCatalog .collect() + map lookup instead of per-event db.get() - listUserNotes: same .collect() approach with early return for empty These queries previously did Promise.all(ids.map(id => db.get(id))) which counted as N separate read operations, exceeding Convex's 4096 read limit for accounts with 500+ starred repos. Fixes adambkovacs#5 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- listRepoSnapshotsByFullNames: replace N indexed queries with single .collect() + in-memory grouping (was exceeding 4096 read limit) - listPortfolioEvents: cap at .take(8192) to stay within Convex max array return size (was returning 9560 events) - DriftChart: replace Math.max(...spread) with iterative loop to avoid stack overflow with large datasets Fixes adambkovacs#6 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@natea is attempting to deploy a commit to the AI Enablement Academy's projects Team on Vercel. A member of the Team first needs to authorize it. |
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
listRepoSnapshotsByFullNames: Replace N individual indexed queries with singlerepoSnapshots.collect()+ in-memory grouping — was exceeding Convex 4096 read limit with 2000+ reposlistPortfolioEvents: Cap results with.take(8192)to stay within Convex max array return size (was returning 9560 events)DriftChart: ReplaceMath.max(...spread)with iterative loop to avoid stack overflow on large datasetsFixes #6
Note: This PR depends on #4 (import-time read limit fixes). Both address scaling issues for accounts with many starred repos.
Test plan
bun run typecheckandbun run lintpass🤖 Generated with Claude Code