mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Cross-process negative-cache race in Realtime's onMessage handler: when the WebSocket opens against a just-created project, an earlier router probe or subscription lookup may have cached projects:\$projectId as empty before the project actually existed. Although the HTTP worker purges on createDocument, a narrow window lets Realtime re-populate the stale empty entry in its own process cache, after which getProjectDB() sees an empty Document and falls back to getConsoleDB(), which looks for users in the console namespace and returns nothing — sessionVerify then fails with 'Session is not valid.' Surfaces on cloud#3214 as a recurring Realtime (dedicated) E2E failure. Diagnosed via [realtime-project-diag] + [realtime-auth-diag] instrumentation — the logs show consoleDb=appwrite consoleNs=console15x (correct), project lookup empty, and subsequent user lookup landing in the console namespace. Purge is bounded: one cache DEL per WS message (not per read), runs only when a projectId is present, and only forces the single projects:\$projectId key to be re-read from adapter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>