Skip to content

Comments

Sundar 🔥 empty response from leaderboard data api#2049

Merged
one-community merged 1 commit intodevelopmentfrom
sundar/fix-leaderboard
Feb 17, 2026
Merged

Sundar 🔥 empty response from leaderboard data api#2049
one-community merged 1 commit intodevelopmentfrom
sundar/fix-leaderboard

Conversation

@sundarmachani
Copy link
Contributor

@sundarmachani sundarmachani commented Feb 15, 2026

Description

Fixes a production issue where the Dashboard Leaderboard was displaying only the logged-in user instead of all eligible members.

The root cause was a runtime error in getLeaderboard() due to unsafe access of weeklySummaries[0].summary when weeklySummaries was empty or contained null values. This caused the function to throw internally, and because the error was being returned instead of thrown, the controller silently fell back to getUserLaborData(), which returns only the requesting user.

This fix ensures:
• Null-safe access of weeklySummaries
• Proper error propagation (no silent fallback)
• Consistent leaderboard behavior across dev and production environments

Related PRS (if any):

NA

Main changes explained:

Improved old code with better error handling and null checks.

How to test:

  1. check into current branch
  2. do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. log as admin user
  5. go to dashboard
  6. verify function “Leaderboard loads” (feel free to include screenshot here)

Note:

None

@one-community one-community changed the title Sundar: Fix empty response from leaderboard data api Sundar 🔥 empty response from leaderboard data api Feb 17, 2026
@one-community one-community merged commit a19959c into development Feb 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants