Skip to content

bug: Admin application lists use key={menteeId}; duplicate keys hide/mis-render cards #759

Description

@yingliu-data

Bug Report

Application list items use key={app.menteeId}, but a mentee can hold multiple applications per cycle, producing duplicate React keys that can hide or mis-render cards.

  • admin-wcc-app/pages/admin/mentorship/index.tsx:215, 232, 249 and admin-wcc-app/components/mentorship/MentorApplicationsPanel.tsx:60key={app.menteeId}.
  • The schema allows one application per (mentee, mentor, cycle) (V19__...create_mentee_applications_table.sql, UNIQUE (mentee_id, mentor_id, cycle_id)), so a mentee who applied to several mentors yields several items sharing the same key. applicationId is returned by the backend but unused.

Reproduction

Pending Review tab for a cycle where mentee 42 applied to two mentors → two cards with key=42 → React logs duplicate-key errors and may render only one card, or reconcile the wrong card when the list updates after accept/decline — hiding applications from the admin.

Severity

Medium

Potential Risk

  • Admins can't see all applications; stateful updates (accept/decline) may mutate the wrong card.

Suggested Fix

  • Use the unique applicationId as the React key everywhere these lists are rendered.
  • Add a test/story with a mentee holding multiple applications and assert all cards render.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontendAll tasks related to admin platform application

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions