fix(decline-applicant): remove runtime crash and clean up state#269
Conversation
Three issues from PR boundlessfi#253 that landed unaddressed: 1. components/bounty/application-review-dashboard.tsx had a fake useEffect stub at the bottom of the file (function useEffect(arg0, arg1) { throw new Error('Function not implemented.'); }) because useEffect was used at line 67 but not imported. The dashboard crashed at runtime whenever the parent re-rendered with new applications. 2. The same file mirrored the applications prop into a reviewApplications local state and synced via the broken effect. The useDeclineApplicant hook already optimistically updates the React Query cache, so the parent re-render delivers the filtered list automatically. Dropped the local mirror, drive directly from the prop. 3. hooks/use-bounty-application.ts wrote both declineReason and declinedReason with the same value on the optimistic update. One was a typo. Kept declineReason since it matches the mutation input name. Removed the unused useMemo import along the way.
|
@Benjtalkshow is attempting to deploy a commit to the Threadflow Team on Vercel. A member of the Team first needs to authorize it. |
|
Warning Review limit reached
More reviews will be available in 42 minutes and 55 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Cleanup for the three issues from PR #253 that landed unaddressed despite multiple review rounds.
Changes
components/bounty/application-review-dashboard.tsxuseEffectstub at the bottom of the file that threwError: Function not implemented.whenever the parent re-rendered with new applications. The hook was used at line 67 but never imported; an AI-generated placeholder satisfied the type checker while crashing at runtime.reviewApplicationsmirror state. TheuseDeclineApplicanthook already updates the React Query cache optimistically, so the parent re-render delivers the filtered list automatically. Single source of truth.useMemoimport.hooks/use-bounty-application.tsdeclinedReasonfield that was being set alongsidedeclineReasonwith the same value. KeptdeclineReasonsince it matches the mutation input name.Verified
pnpm tsc --noEmitcleanpnpm lintclean (only the pre-existingserver-graphql.tswarning)