flowfi icon indicating copy to clipboard operation
flowfi copied to clipboard

[Frontend] Handle rejections in webhook toggle/delete handlers

Open blurbeast opened this issue 2 weeks ago • 3 comments

Overview & Background

The webhook toggle and delete handlers are async with no try/catch, and WebhookTable invokes them from onClick without void/.catch() — the return value is discarded by React. Any API failure becomes an unhandled promise rejection with no user feedback and no state rollback (the toggle UI still flips optimistically via a refetch that never runs). Delete also uses raw window.confirm, inconsistent with the custom confirm modals used everywhere else.


Technical Specification & Architecture

  1. Wrap handlers in frontend/src/app/settings/webhooks/page.tsx:23 with try/catch and toast.error feedback.
  2. Call them as onClick={() => void onToggle(subscription).catch(...)} from frontend/src/components/webhooks/WebhookTable.tsx:9, or fold the async logic into a mutation hook.
  3. Replace window.confirm with the shared ConfirmModal/CancelConfirmModal pattern.

Target Files

  • frontend/src/app/settings/webhooks/page.tsx
  • frontend/src/components/webhooks/WebhookTable.tsx

Acceptance Criteria

  • [ ] API failures surface an error toast and leave state consistent.
  • [ ] No unhandled promise rejections in console.
  • [ ] Delete uses the shared confirm modal.
  • [ ] Tests assert error handling on toggle/delete rejection.

blurbeast avatar Nov 18 '26 19:11 blurbeast

@samjay8 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.

I can fix this

ℹ️ Repo Maintainers: To accept this application, review their application or assign @samjay8 to this issue.

samjay8 avatar Nov 20 '26 12:11 samjay8

Congratulations, @samjay8! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.

🧑‍💻 @samjay8: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

🌊 Happy Wave 🌊

drips-wave[bot] avatar Nov 20 '26 12:11 drips-wave[bot]

This issue has been completed by @samjay8 as part of the Stellar Wave Program's 11th Wave 🥳

😎 @samjay8: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

drips-wave[bot] avatar Nov 21 '26 14:11 drips-wave[bot]