CC-47: TOs Cannot See Player Real Names#323
Conversation
Fixes CC-42
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe function 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@convex/_model/users/_helpers/checkUserTournamentRelationship.ts`:
- Line 35: The current implementation in checkUserTournamentRelationship
reconstructs new Set(userBTournamentIds) inside the .some() callback on every
iteration; hoist the Set creation before the loop by creating a constant (e.g.,
userBTournamentSet = new Set(userBTournamentIds)) and then use
userATournamentIds.some(id => userBTournamentSet.has(id)) so the Set is
allocated once and reused.
- Around line 13-29: In checkUserTournamentRelationship, the four independent DB
queries (tournamentRegistrations and tournamentOrganizers for userIdA and
userIdB) are run sequentially; run them in parallel using Promise.all to reduce
latency by invoking ctx.db.query('tournamentRegistrations').withIndex(... for
userIdA), ctx.db.query('tournamentOrganizers').withIndex(... for userIdA), and
the two equivalent queries for userIdB inside a Promise.all, then destructure
the results into userARegistrations, userAOrganizers, userBRegistrations,
userBOrganizers and continue building userATournamentIds and userBTournamentIds
as before.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 513ae614-955d-4b54-9eb6-d1201b433960
📒 Files selected for processing (1)
convex/_model/users/_helpers/checkUserTournamentRelationship.ts
Fixes CC-47
Summary by CodeRabbit