{"record":{"id":"cb2d60babfe287a4","repo":"tinyhumansai/openhuman","slug":"core-state-memory-client-sync-failed-during-refr","errorCode":null,"errorMessage":"[core-state] memory client sync failed during refresh:","messagePattern":"\\[core-state\\] memory client sync failed during refresh:","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/providers/CoreStateProvider.tsx","lineNumber":464,"sourceCode":"      // the token it was authed with has been invalidated by the core.\n      socketService.disconnect();\n    }\n    // Same-user re-login (seedUserId === nextIdentity) and cold bootstrap\n    // with matching seed are no-ops — redux-persist already loaded the\n    // right namespace and the active user id is already correct.\n    syncAnalyticsConsent(snapshot.analyticsEnabled);\n\n    if (!snapshot.sessionToken) {\n      memoryTokenRef.current = null;\n      return;\n    }\n\n    if (memoryTokenRef.current !== snapshot.sessionToken) {\n      try {\n        await syncMemoryClientToken(snapshot.sessionToken);\n        memoryTokenRef.current = snapshot.sessionToken;\n      } catch (error) {\n        console.warn('[core-state] memory client sync failed during refresh:', error);\n      }\n    }\n  }, [commitState, t]);\n\n  /** Serialized refresh — all callers share the same in-flight promise. */\n  const refresh = useCallback(async () => {\n    if (refreshInFlightRef.current) {\n      return refreshInFlightRef.current;\n    }\n    const promise = refreshCore().finally(() => {\n      refreshInFlightRef.current = null;\n    });\n    refreshInFlightRef.current = promise;\n    return promise;\n  }, [refreshCore]);\n\n  const refreshTeams = useCallback(async () => {\n    const requestId = ++teamsRequestIdRef.current;","sourceCodeStart":446,"sourceCodeEnd":482,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/app/src/providers/CoreStateProvider.tsx#L446-L482","documentation":"Syncing the memory client's auth token failed during a core-state refresh: syncMemoryClientToken rejected while applying a new snapshot.sessionToken to the memory client (whose token differed from memoryTokenRef). The refresh continues past the failure, but memory operations (sync, search) may run unauthenticated or fail until the next refresh tick retries the sync.","triggerScenarios":"Thrown at app/src/providers/CoreStateProvider.tsx:464 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the warned error for the sync layer — memory client connect or token apply","Rely on the next refresh cycle to re-attempt the token sync automatically","If memory features fail in the UI (search/sync errors), confirm the core memory service is healthy","Persistent failures: inspect the memory client logs for auth rejection reasons"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}