Skip to content

CC-47: TOs Cannot See Player Real Names#323

Merged
ianpaschal merged 2 commits into
mainfrom
ian/cc-47-tos-cannot-see-player-real-names
May 8, 2026
Merged

CC-47: TOs Cannot See Player Real Names#323
ianpaschal merged 2 commits into
mainfrom
ian/cc-47-tos-cannot-see-player-real-names

Conversation

@ianpaschal
Copy link
Copy Markdown
Owner

@ianpaschal ianpaschal commented May 8, 2026

Fixes CC-47

Summary by CodeRabbit

  • Bug Fixes
    • Improved tournament relationship detection to now recognize connections through both participant registrations and tournament organizer roles, ensuring more comprehensive relationship matching between users.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
combat-command Error Error May 8, 2026 8:50pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 8b4c1d8f-655e-4b24-b52b-0e070130bee2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • ✅ Review completed - (🔄 Check again to review again)

Walkthrough

The function checkUserTournamentRelationship is modified to evaluate both tournament registrations and tournament organizer relationships when determining if two users share a tournament connection. The implementation adds queries to the tournamentOrganizers table indexed by user for both userIdA and userIdB, then expands each user's tournament-id collection to include tournaments from both their registrations and their organizer roles before performing the final set intersection check.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete and fails to meet the repository template requirements. It lacks the required 'Resolves' section with an issue number and provides minimal context beyond a brief reference. Complete the description by adding 'Resolves: #CC-47' (or appropriate issue number) and explain how the checkUserTournamentRelationship changes address the tournament organizer visibility issue.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: tournament organizers cannot see player real names, which aligns with the file modification to checkUserTournamentRelationship that now includes tournament organizers in relationship checks.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ian/cc-47-tos-cannot-see-player-real-names

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 90e0c5b and 456ae44.

📒 Files selected for processing (1)
  • convex/_model/users/_helpers/checkUserTournamentRelationship.ts

Comment thread convex/_model/users/_helpers/checkUserTournamentRelationship.ts Outdated
Comment thread convex/_model/users/_helpers/checkUserTournamentRelationship.ts Outdated
@ianpaschal ianpaschal merged commit 8299829 into main May 8, 2026
2 of 3 checks passed
@ianpaschal ianpaschal deleted the ian/cc-47-tos-cannot-see-player-real-names branch May 8, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant