tinyhumansai/openhuman · error

[useRefetchSnapshotOnTurnEnd] failed to refetch user state:

Error message

[useRefetchSnapshotOnTurnEnd] failed to refetch user state:

What it means

Fire-and-forget warning in useRefetchSnapshotOnTurnEnd: after a debounced 750ms window following a turn end, a userApi.getMe() refresh rejected. Because this is a best-effort snapshot patch, the catch only logs — the stale currentUser snapshot stays until the next successful refetch or full reload; the chat turn itself is unaffected.

Source

Thrown at app/src/hooks/useRefetchSnapshotOnTurnEnd.ts:39

      }
    };
  }, []);

  const refetch = useCallback(() => {
    if (debounceTimerRef.current !== null) {
      window.clearTimeout(debounceTimerRef.current);
    }

    debounceTimerRef.current = window.setTimeout(() => {
      debounceTimerRef.current = null;

      // Fire-and-forget on a microtask
      void (async () => {
        try {
          const user = await userApi.getMe();
          patchSnapshot({ currentUser: user });
        } catch (error) {
          console.warn('[useRefetchSnapshotOnTurnEnd] failed to refetch user state:', error);
        }
      })();
    }, 750);
  }, [patchSnapshot]);

  return { refetch };
}

View on GitHub (pinned to 7491200858)

Solutions

  1. No user-facing action needed — next refetch or reload corrects the snapshot
  2. If persistent, check session expiry and trigger re-auth
  3. Debounce-unrelated retries can piggyback on the next turn-end event
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at app/src/hooks/useRefetchSnapshotOnTurnEnd.ts:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/a0bf021cfa78a887. Report an issue: GitHub.