Skip to content

fix(#548): derive volunteer match status from live opportunities#549

Merged
need4deed merged 3 commits into
developfrom
fix/548-volunteer-header-match-status
May 21, 2026
Merged

fix(#548): derive volunteer match status from live opportunities#549
need4deed merged 3 commits into
developfrom
fix/548-volunteer-header-match-status

Conversation

@nadavosa
Copy link
Copy Markdown
Collaborator

Summary

  • VolunteerHeader was reading volunteer.statusMatch — a stored DB field that the BE never updates when opportunity-volunteer statuses change
  • Now derives match status directly from the ["volunteer-opportunities", volunteerId] React Query cache, which VolunteerOpportunities already keeps up-to-date
  • No extra network request: React Query deduplicates the identical query key

Derivation rules (highest priority wins):

Opportunity status Displayed match status
Any MATCHED or ACTIVE Matched
Any PENDING Pending match
Only PAST Past
None No matches

Closes #548

Test plan

  • Volunteer with no opportunities → header shows "No matches"
  • Volunteer with a pending opportunity → header shows "Pending match"
  • Volunteer with a matched opportunity → header shows "Matched"
  • Mark a pending opportunity as Matched → header updates immediately
  • Mark active back to past → header updates to "Past" if no other active/matched opps
  • Volunteer profile still loads and engagement status row still works

🤖 Generated with Claude Code

nadavosa and others added 3 commits May 21, 2026 12:07
…le statusMatch

volunteer.statusMatch is never updated by the BE when opportunity-volunteer
status changes, so the header always showed the original DB value. Now the
header queries the same opportunities cache used by VolunteerOpportunities
and derives the badge from actual opportunity statuses — no extra request
since React Query deduplicates the key.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nadavosa nadavosa force-pushed the fix/548-volunteer-header-match-status branch from e14d81a to 193985b Compare May 21, 2026 10:07
@need4deed need4deed merged commit 52404a2 into develop May 21, 2026
1 check passed
@need4deed need4deed deleted the fix/548-volunteer-header-match-status branch May 21, 2026 10:21
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.

bug: volunteer header shows stale match status — not updated when opportunity match changes

2 participants