-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Hardcoded Dummy Administrators in Hackathon Preview
Description
When previewing a hackathon in the "Review" tab before publishing, the Administrators section displays hardcoded mock names instead of the actual hackathon creator or any invited administrators. This is a visual bug that surfaces fabricated data to real users during a critical step in the hackathon creation flow.
Dummy Data Currently Displayed:
- Brooklyn Simmons (OWNER)
- Annette Black (ADMIN)
- Cody Fisher (ADMIN)
- Ronald Richards (ADMIN)
Impact: Low/Medium — while purely visual, this creates genuine confusion for users who see unfamiliar names listed as administrators of their own hackathon, undermining trust in the preview and the creation flow overall.
Step-by-Step Reproduction
- Navigate to "Host Hackathon" to start the creation wizard (
/organizations/[id]/hackathons/new) - Fill in the required details up to the "Review" tab
- Open the "Judging" or "Review" section
- Observed: The "Administrators" list shows "Brooklyn Simmons" and the other mock names listed above
- Expected: The list should show only the hackathon creator (the current authenticated user) as Owner, and any actual administrators added during the creation process
Root Cause Analysis
The mock data is hardcoded directly in the UI component as a static fallback, and the actual administrator data is never retrieved or passed down from parent components.
Hardcoded Mock Array
In components/organization/hackathons/new/tabs/components/review/JudgingSection.tsx, a defaultAdministrators array (lines 22–47) contains the dummy names. This array was likely used as placeholder scaffolding during development and was never replaced with real data.
Missing Data Flow
The JudgingSection component (line 51) defaults to the defaultAdministrators mock array when the administrators prop is undefined. The problem is that neither SectionRenderer.tsx nor ReviewTab.tsx currently retrieve or pass actual administrator or creator data to this component — so the prop is always undefined in production, and the mock data always renders.
Technical Details
Files to Modify
1. components/organization/hackathons/new/tabs/components/review/JudgingSection.tsx
- Action: Remove the
defaultAdministratorsmock array entirely (lines 22–47) - Update the component to gracefully handle an empty,
undefined, or loading state foradministrators— render an appropriate empty state or skeleton rather than falling back to mock data - The component must never render fabricated names under any circumstance, including during loading
2. components/organization/hackathons/new/tabs/review/ReviewTab.tsx
- Action: Retrieve the current authenticated user session (e.g., via
authClient.getSession()) and construct a minimal administrator entry representing the creator as"OWNER" - Pass the user's name, email, and/or avatar as the initial administrator to the downstream renderer
- Handle the case where session data is still resolving — defer rendering the administrators list or show a loading skeleton until the session is available, rather than rendering with empty or null values
3. components/organization/hackathons/new/tabs/components/review/SectionRenderer.tsx
- Action: Accept an
administratorsprop and pass it down toJudgingSection - Ensure the prop is correctly typed — strictly no
anytypes
Relevant Components
JudgingSection.tsx— renders the administrators list in the review previewReviewTab.tsx— parent responsible for retrieving session data and composing the previewSectionRenderer.tsx— intermediary that must thread theadministratorsprop through toJudgingSection
Proposed Resolution Plan
-
Delete the mock data — remove the
defaultAdministratorsarray fromJudgingSection.tsxentirely -
Pass real session data — update
ReviewTab.tsxto retrieve the current user and pass them as the"OWNER"administrator entry, usingauthClient.getSession()or the equivalent session hook already used elsewhere in the wizard -
Thread the prop — update
SectionRenderer.tsxto accept and forward theadministratorsprop toJudgingSection -
Handle loading gracefully — ensure
JudgingSectiondoes not crash or render mock data while session data is still resolving; use a skeleton or deferred render pattern consistent with the rest of the creation wizard
⚠️ Caution
This is a production environment — not a sandbox.
- Code must be performant, accessible, and clean
- No dummy data — the
defaultAdministratorsarray must be fully removed; no static fallback names should exist anywhere in the component tree - AI-generated code will be scrutinized; poorly structured or "hallucinated" code will result in immediate issue closure
- Follow the existing design system: shadcn/ui, Tailwind, Framer Motion
- Strictly no
anytypes in prop definitions or the administrator data shape
Testing & Verification
Automated Tests
npm run lint # Ensure code quality
npm run build # Verify no breaking changes in routing or typesManual Verification
- Navigate through the hackathon creation wizard to the "Review" tab — confirm none of the mock names (Brooklyn Simmons, Annette Black, Cody Fisher, Ronald Richards) appear anywhere in the preview
- Confirm the current authenticated user is shown as "OWNER" in the Administrators section of the review preview
- Verify the component does not crash or render empty while the session is still loading — confirm a skeleton or deferred render is shown instead
- Confirm the
defaultAdministratorsarray is fully removed fromJudgingSection.tsx— no static fallback data remains in the file - Verify
SectionRenderer.tsxcorrectly accepts and forwards theadministratorsprop toJudgingSectionwithout anyanytypes in the prop definition - Test with a slow or delayed session response — confirm the administrators list does not flash mock data before resolving to the real user
- Verify there is no regression in the rest of the Review tab — all other sections should render correctly after the prop threading changes to
SectionRenderer.tsx - Provide video evidence