Skip to content

Status analytics auto-refresh re-polls a frozen time window #1439

Description

@kylebernhardy

StatusTabs.tsx computes startTime/endTime once via Date.now() in the context memo (src/features/instance/status/analytics/StatusTabs.tsx:106-120), and those values are baked into the react-query key. refetchInterval then re-fetches the same fixed window forever — after an hour on "Last 1 hour" the charts show hour-old data while still issuing 5–8 POSTs per tick per tab against the customer's Harper. The "Updated Xs ago" freshness pill makes it look current.

Suggested fix: hoist the clock — a single interval in StatusTabsInner that slides the window every refreshMs (the manual-refresh tick mechanism already does this), and drop the per-query refetchInterval in useAnalyticsRecords.ts. keepPreviousData already smooths the key swap.

Filed from a Status tab code review.

Comment generated by kAIle (Claude Fable 5)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions