Repository navigation
Fix/public n private tournament join status check - #778
ruhandave19 wants to merge 2 commits into
Conversation
Signed-off-by: Ruhan <ruhandave14@gmail.com>
Signed-off-by: Ruhan <ruhandave14@gmail.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Upcoming-only join checks backend/controllers/tournament_controller.go, backend/tests/routes_test.go |
Both join handlers restrict updates to upcoming tournaments and return a closed-joining error for other statuses. MongoDB-backed tests check response codes and stored participant or join-request counts. |
Priority:
Estimated code review effort: 2 (Simple) | ~12 minutes
Change: Bug fix
Possibly related issues
AOSSIE-Org/DebateAI#740— Reports successful joins to live and completed tournaments and calls for an atomic upcoming-status check.
Possibly related PRs
- AOSSIE-Org/DebateAI#777 — Fixes the public-join lifecycle defect; this PR also applies the status check to private join requests.
- AOSSIE-Org/DebateAI#690 — Implements the same admission rule through
TournamentService; this PR applies it in the controller handlers.
Suggested reviewers: zaibamachhaliya, basharkhan7776
Merge Risk: 
Low · up to 9ee85
-
Retrying a rejected request after a private tournament closes can erase that request. The impact is limited, but owners should account for it before merging.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
Link your account with GitcordThanks for opening this PR, @ruhandave19! To receive Discord notifications and contributor tracking for this organization:
Once linked, Gitcord can notify you about reviews, merges, and more. — Posted by Gitcord |
Addressed Issues:
Fixes Part of #740
Screenshots/Recordings:
Public Tournament fix-
Private Tournament fix -
Additional Notes:
This only focuses on a part of the issue, wherein previously the user could join public and private tournaments that are live or completed.
The remaining parts can be covered in upcoming PRs, based on the feedback given to this PR.
The changes made are:
2)In backend/tests/routes_test.go: 2 new tests 'TestJoinPublicTournamentLifecycleValidation' and 'TestJoinPrivateTournamentLifecycleValidation' were added, which create tournaments with upcoming, live, and completed status in a throwaway database and checks that the upcoming tournament accepts the join (200, participant added) and live and completed tournaments reject it (400, no participant added).
NOTE: To run the test and verify the changes, MONGO_TEST_URI will need to be set in the terminal, if it is not, the test will fail.
To verify, run the following in backend/ -
Both should PASS
Check one of the checkboxes below:
I have used the following AI models and tools: Claude Sonnet 5.5
Checklist
Summary by CodeRabbit