-
[OPIK-5907] [FE] fix: prevent home page blink on stats refetch (#6293)
发布于
2026-04-15 13:37:15 +00:00 The
useProjectOnboardingStatshook gated its return onisLoading,
which in React Query v5 isisPending && isFetching. When a query
errors (e.g. /blueprints/history/... returning 404 in some envs), it
never gets cached data, soisPendingstays true forever. Every 30s
refetch flippedisFetching→isLoading→ hook returnedundefined
→ bridgecontext:changedfired → Ollie iframe blinked.Switch the gate to
isFetched, which becomes true after the first
fetch completes (success OR error) and stays true across refetches.
Also memoize the returned stats object so identical values don't
produce new references that would cascade intocontext:changed
emits.Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
下载附件