Skip to content

perf(dashboards): auto-refresh keeps the window snapped and skips unmoved tiles - #2687

Open
Makisuo wants to merge 4 commits into
mainfrom
perf/rawsql-widget-sliding-window
Open

Makisuo wants to merge 4 commits into
mainfrom
perf/rawsql-widget-sliding-window

fix(share): a tick does not resend a retry that is still in flight

23762ba
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review completed Nov 16, 2026 in 3m 49s

Confidence 6/10 · 1 issue to address

🟡 Confidence 6/10 · needs attention. Held at 6 because a correctness warning is open.
1 warning −1 · tests covered · risk medium

Auto-refresh ticks now plan on the cache grid and ask only for keys the page does not hold, on both the dashboard and the share page. Share is correct; on the dashboard the new clock never reaches planWidgetRequest, so pinned tiles still resolve on Date.now().

  • clockRead replaces refreshVersion === 0 as the snap switch on both pages
  • A tick plans in Tick mode with Load requests, so an unmoved window fetches nothing
  • Share ticks drop only failedKeys, so a failed tile retries once per tick
  • Share request keys now include the tile's own pinned window

Findings

🟠 Warning · F3 · Pinned tiles ignore clock: planWidgetRequest has no such field

correctness · apps/web/src/page/dashboards/kit/widget-data.ts:140

planWidgetRequest's input carries nowMs and snap, never clock (packages/query-engine/src/widget-request.ts:45), so this property is dropped without a type error. A pinned tile still resolves its range on Date.now(), always snapped: after a Reload it stays a grid step behind the board, and the scene test passes only when the real 15 s grid moves.

		...(input.clock === undefined ? undefined : { nowMs: input.clock.nowMs, snap: input.clock.snap }),
What was checked
  • Share's reload/flush pass { snap, nowMs } straight to resolveTimeRangeWindow, so share keys move on the read clock
  • Rec.filter(model.requested, (key, widgetId) => ...) is value-first, matching apps/cli/src/core/config.ts:105
  • Dashboard Keyed.request(..., "Load") still defers held and in-flight keys, so the change stays confined to the mode

23762ba · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

Annotations

Check warning on line 140 in apps/web/src/page/dashboards/kit/widget-data.ts

See this annotation in the file changed.

@maple-review-bot maple-review-bot / Maple / review

correctness: Pinned tiles ignore `clock`: `planWidgetRequest` has no such field

`planWidgetRequest`'s input carries `nowMs` and `snap`, never `clock` (`packages/query-engine/src/widget-request.ts:45`), so this property is dropped without a type error. A pinned tile still resolves its range on `Date.now()`, always snapped: after a Reload it stays a grid step behind the board, and the scene test passes only when the real 15 s grid moves.