发布

  • [OPIK-5907] [FE] fix: prevent home page blink on stats refetch (#6293)

    frostbyte_neo 发布于 2026-04-15 13:37:15 +00:00

    The useProjectOnboardingStats hook gated its return on isLoading,
    which in React Query v5 is isPending && isFetching. When a query
    errors (e.g. /blueprints/history/... returning 404 in some envs), it
    never gets cached data, so isPending stays true forever. Every 30s
    refetch flipped isFetchingisLoading → hook returned undefined
    → bridge context:changed fired → 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 into context:changed
    emits.

    Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com

    下载附件