Difficulty: Advanced | Type: Feature / Performance
Background: POST /v1/members/:address/roles assigns a role to a member from the admin dashboard.
Problem: Without optimistic updates, the admin sees no immediate feedback in the member list/detail view until the round-trip completes, which feels sluggish especially over a real network in live mode.
Expected Outcome: The UI immediately reflects the intended role change optimistically, then reconciles with the server response — rolling back cleanly and showing an error toast (from #20) if the mutation actually fails.
Suggested Implementation: Use React Query's useMutation onMutate/onError/onSettled lifecycle to snapshot and optimistically update the relevant cached member record, rolling back to the snapshot on failure, building on the query-key strategy from #22.
Acceptance Criteria:
- Role change appears instantly in the UI on submit.
- A simulated failure (mock mode error scenario) correctly rolls back the optimistic change and shows an error.
- No duplicate/ghost roles appear after a slow-but-successful mutation.
Likely Affected Files/Directories: app/admin/*, lib/api/
Labels: feature, performance, GrantFox OSS, Maybe Rewarded, Official Campaign | FWC26
Difficulty: Advanced | Type: Feature / Performance
Background:
POST /v1/members/:address/rolesassigns a role to a member from the admin dashboard.Problem: Without optimistic updates, the admin sees no immediate feedback in the member list/detail view until the round-trip completes, which feels sluggish especially over a real network in live mode.
Expected Outcome: The UI immediately reflects the intended role change optimistically, then reconciles with the server response — rolling back cleanly and showing an error toast (from #20) if the mutation actually fails.
Suggested Implementation: Use React Query's
useMutationonMutate/onError/onSettledlifecycle to snapshot and optimistically update the relevant cached member record, rolling back to the snapshot on failure, building on the query-key strategy from #22.Acceptance Criteria:
Likely Affected Files/Directories:
app/admin/*,lib/api/Labels:
feature,performance,GrantFox OSS,Maybe Rewarded,Official Campaign | FWC26