fix(web): include start/end in webhook notifications query key - #268
Conversation
Date filter changes for webhook history were ignored by react-query because start and end were only sent as request params, not cache keys. Fixes vernu#256
|
@kalayciburak is attempting to deploy a commit to the vernu's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThe webhook notification hook now uses a centralized query-key factory that includes all filters, including start and end dates. Tests verify distinct keys and confirm that changing the start date triggers a new request. ChangesWebhook notification cache invalidation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the Comment |
vernu
left a comment
There was a problem hiding this comment.
@kalayciburak thanks for contributing
Summary
useWebhookNotificationssentstartandendas request query params but omitted them from the react-queryqueryKey. Changing the webhook history date filter therefore reused a cached response instead of refetching.This moves the key into
queryKeys.webhookNotifications(includingstart/end) and adds regression coverage.Fixes #256
Test plan
npx vitest run lib/api/query-keys.test.ts lib/api/hooks.test.tsx lib/api/cache-invalidation.test.tsx(7/7)npx vitest runinweb/(195/195)npx tsc --noEmitinweb/npx eslinton touched filesSummary by CodeRabbit
Bug Fixes
Tests