Skip to content

Yk/Volunteer Bugbash - #212

Merged
Yurika-Kan merged 4 commits into
mainfrom
yk/volunteer-bugbash
Sep 8, 2026
Merged

Yurika-Kan merged 4 commits into
mainfrom
yk/volunteer-bugbash

Conversation

@Yurika-Kan

Copy link
Copy Markdown
Collaborator

ℹ️ Issue

ssf bugbash sheet

bash deez bugs of volunteer last huzzah

📝 Description

  • Bad ?orderId= deep link silent → fixed: alert added, volunteerOrderManagement.tsx
  • Bad ?requestId= deep link silent → fixed: alert added, foodRequestManagement.tsx
  • "Delete Order" says delete, only closes → copy mismatch, left as-is (confirmed fine)
  • Close Request 500s on email fail → root cause confirmed, fix pending (log-and-continue, ticket exists)
  • Volunteer can hard-delete active request → gate too loose, blocked on Close-Request fix above

✔️ Verification

replicated bug then fixed bug then smoke tested

Copilot AI lite review requested due to automatic review settings September 6, 2026 01:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new “Request not found” alert still won’t trigger for malformed ?requestId= values because NaN is treated as falsy by the early-return guard in foodRequestManagement.tsx.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR improves volunteer-facing deep-link behavior by showing an error alert and cleaning up the URL when an orderId / requestId query parameter doesn’t map to an existing record, instead of failing silently.

Changes:

  • Add an “Order not found” alert + URL replace when ?orderId= doesn’t match any loaded volunteer orders.
  • Add a “Request not found” alert + URL replace when ?requestId= doesn’t match any loaded volunteer requests.
  • Update effect dependency arrays to include setAlertMessage.
File summaries
File Description
apps/frontend/src/containers/volunteerOrderManagement.tsx Shows an error alert + replaces the URL when a deeplinked orderId isn’t found.
apps/frontend/src/components/foodRequestManagement.tsx Shows an error alert + replaces the URL when a deeplinked requestId isn’t found (but needs a small fix for malformed IDs).
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 97 to 100
} else {
setAlertMessage('Request not found.', AlertStatus.ERROR);
navigate(location.pathname, { replace: true });
}
}
}
} else {
setAlertMessage('Order not found.', AlertStatus.ERROR);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

look to see if the same copilot comment applies here

Yurika-Kan and others added 3 commits September 5, 2026 21:35
Effect used `!initialRequestId`, which treats NaN as falsy and returns
early. Malformed ?requestId= values became NaN via Number(), so the
alert never fired. Check for undefined explicitly instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Yurika-Kan

Copy link
Copy Markdown
Collaborator Author
  • ux routing: route guards showed spinner/"Oops!" but never actually blocked wrong-role users → added allowedRoles per route + role check in ProtectedRoute, redirects to /unauthorized
  • refresh ux: role-gate had a one-frame flash to /unauthorized on refresh before user data loaded → context loading now defaults true, cleared only after fetch settles
  • unauthorized ui: unauthorized page was raw unstyled HTML → rebuilt with Chakra, centered, links back to profile
  • efficient fetches: navbar and protectedRoute each independently fetched /api/users/me → lifted into shared UserProvider context (userContext.tsx), one fetch per session instead of one per component/route mount

@jiang-h-y jiang-h-y left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@Yurika-Kan
Yurika-Kan merged commit 35a521d into main Sep 8, 2026
6 checks passed
@Yurika-Kan
Yurika-Kan deleted the yk/volunteer-bugbash branch September 8, 2026 07:06
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.

4 participants