Summary of What Needs to be Done
Add a null/undefined guard for c.username in the buildRanksMap function in src/utils/leaderboardUtils.js. The function directly accesses c.username as a Map key without checking for null/undefined. If a contributor object has a null or undefined username, the map key becomes null/undefined, causing silent rank collisions where multiple contributors overwrite each other's slot.
Changes
In buildRanksMap, add a guard if (!c?.username) return to skip entries without a valid username. This prevents null-key collisions and ensures the rank map only contains valid contributor entries.
Impact
Severity: Low — Silent data corruption in leaderboard ranking. Rank display may show incorrect positions if any contributor has a null/undefined username. No crash, but incorrect rankings could mislead users.
Please assign this task to me.
Summary of What Needs to be Done
Add a null/undefined guard for c.username in the buildRanksMap function in src/utils/leaderboardUtils.js. The function directly accesses c.username as a Map key without checking for null/undefined. If a contributor object has a null or undefined username, the map key becomes null/undefined, causing silent rank collisions where multiple contributors overwrite each other's slot.
Changes
In buildRanksMap, add a guard if (!c?.username) return to skip entries without a valid username. This prevents null-key collisions and ensures the rank map only contains valid contributor entries.
Impact
Severity: Low — Silent data corruption in leaderboard ranking. Rank display may show incorrect positions if any contributor has a null/undefined username. No crash, but incorrect rankings could mislead users.
Please assign this task to me.