fix: undefined xcpcio scoreboard team_id#1082
Conversation
WalkthroughTwo distinct changes across the codebase: First, the Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)packages/scoreboard-xcpcio/index.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (4)
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.
Pull Request Overview
This PR fixes an issue where team_id was undefined in the XCPCIO scoreboard due to journal entries (tsdoc detail entries) not having a uid property. The fix also removes an extraneous %} in a Jinja2 template.
- Fixed template syntax error with extra
%}in the scratchpad condition - Added optional
uidparameter tosubmissionBase()function to handle cases whererdoc.uidmay be undefined - Updated the call in
loadContestState()to explicitly passi.uidfor journal entries
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/ui-default/templates/partials/problem_sidebar_contest.html | Removed extraneous %} from Jinja2 conditional statement |
| packages/scoreboard-xcpcio/index.ts | Fixed undefined team_id by adding optional uid parameter to submissionBase() and passing it explicitly for journal entries |
Comments suppressed due to low confidence (2)
packages/scoreboard-xcpcio/index.ts:102
- The
submissionBasefunction is called without passing theuidparameter. Whenrdocis a RecordDoc with a validuid, this works. However, for consistency with the fix applied at line 63, and to ensure the sameteam_idlogic is applied, consider passing theuidexplicitly if available. Ifrdoc.uidmight be undefined here as well, this call should be updated to pass the correctuidparameter.
else realtime.submissions.push({ ...submissionBase(tdoc, rdoc), status: statusStr });
packages/scoreboard-xcpcio/index.ts:107
- The
submissionBasefunction is called without passing theuidparameter. Whenrdocis a RecordDoc with a validuid, this works. However, for consistency with the fix applied at line 63, and to ensure the sameteam_idlogic is applied, consider passing theuidexplicitly if available. Ifrdoc.uidmight be undefined here as well, this call should be updated to pass the correctuidparameter.
else pub.submissions.push({ ...submissionBase(tdoc, rdoc), status: isLocked ? 'PENDING' : statusStr });
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary by CodeRabbit
Bug Fixes