Skip to content

Web: webhook history date filter never refetches #256

Description

@vernu

In useWebhookNotifications (web/lib/api/hooks.ts), start and end go into the request URL but are missing from the query key:

queryKey: [
  'webhook-notification',
  eventType,
  page,
  limit,
  deviceId,
  webhookSubscriptionId,
  status,
],
queryFn: () =>
  httpBrowserClient.get(`...&start=${start}&end=${end}&...`)

react-query only refetches when the key changes, so switching the date range on the webhook history page (say from Last 90 Days to Last 7 Days) serves the cached result for the old range. Same for a custom range. The server does filter on these params (webhook.service.ts builds a createdAt match from them), the request just never goes out again. The filter looks applied but the table never changes.

Fix is adding start and end to the key array.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomerswebWeb dashboard

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions