Skip to content

fix(all-users): read legacy programId formats#777

Merged
ismaeldosil merged 2 commits intomasterfrom
fix/legacy-programid-format
Jan 27, 2026
Merged

fix(all-users): read legacy programId formats#777
ismaeldosil merged 2 commits intomasterfrom
fix/legacy-programid-format

Conversation

@ismaeldosil
Copy link
Collaborator

@ismaeldosil ismaeldosil commented Jan 27, 2026

Summary

  • Add fallback logic to read program data from multiple user field formats
  • Fixes program display for 55 users with legacy programId string format
  • Also handles legacy program field (could be name or ID)

Changes

Modified getAllUsers() in Firebase.tsx to check formats in priority order:

  1. programs array (current format) - 44 users
  2. programId string (legacy format) - 55 users ← now fixed
  3. program field (legacy name or ID)

Test plan

  • All Users dashboard shows program names for legacy users
  • Search by program name works
  • CSV export includes program names

Add fallback logic to read program data from multiple field formats:
- Priority 1: programs array (current format)
- Priority 2: programId string (legacy format - 55 users)
- Priority 3: program field (legacy name or ID)

This fixes program display for users with legacy data structures.

Closes CHALK-080
Some users have the program NAME stored in programs[] instead of the ID.
Added fallback to check if the value is a known program name when ID
lookup fails.

Closes CHALK-080
@ismaeldosil ismaeldosil merged commit 57bb185 into master Jan 27, 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.

1 participant