Skip to content

Commit

Permalink
fix(app): fix LPC offsets not appropriately updating (#14487)
Browse files Browse the repository at this point in the history
Closes RQA-2296

The staleTime property was not handled correctly by the useNotifyService notification hook. In
addition to disabling notifications when using staleTime, we must also alert the HTTP hook that it
is responsible for refetching HTTP data.
  • Loading branch information
mjhuff authored Feb 13, 2024
1 parent 9badd57 commit 23146ba
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export function useNotifyCurrentMaintenanceRun(
},
})

const isNotifyEnabled = !isNotifyError && !options?.forceHttpPolling
const isNotifyEnabled =
!isNotifyError &&
!options?.forceHttpPolling &&
options?.staleTime !== Infinity

if (!isNotifyEnabled && !refetchUsingHTTP) setRefetchUsingHTTP(true)
const isHTTPEnabled =
host !== null && options?.enabled !== false && refetchUsingHTTP
Expand Down
6 changes: 5 additions & 1 deletion app/src/resources/runs/useNotifyAllRunsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export function useNotifyAllRunsQuery(
options,
})

const isNotifyEnabled = !isNotifyError && !options?.forceHttpPolling
const isNotifyEnabled =
!isNotifyError &&
!options?.forceHttpPolling &&
options?.staleTime !== Infinity

if (!isNotifyEnabled && !refetchUsingHTTP) setRefetchUsingHTTP(true)
const isHTTPEnabled = options?.enabled !== false && refetchUsingHTTP

Expand Down
6 changes: 5 additions & 1 deletion app/src/resources/runs/useNotifyRunQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ export function useNotifyRunQuery<TError = Error>(
options: { ...options, enabled: options.enabled && runId != null },
})

const isNotifyEnabled = !isNotifyError && !options?.forceHttpPolling
const isNotifyEnabled =
!isNotifyError &&
!options?.forceHttpPolling &&
options?.staleTime !== Infinity

if (!isNotifyEnabled && !refetchUsingHTTP) setRefetchUsingHTTP(true)
const isHTTPEnabled =
options?.enabled !== false &&
Expand Down

0 comments on commit 23146ba

Please sign in to comment.