Files

3.3 KiB
Raw Permalink Blame History

Generation 1 – Hypergrid presence and GridUser online ghosts

Evidence (production, November 18, 2026; read-only): Presence contained four old sessions with RegionID=00000000-0000-0000-0000-000000000000; all lacked local UserAccounts. GridUser had 483 foreign UUIs with Online=True and 485 foreign UUIs with Online=False. Across 467 avatar UUIDs, both statuses existed under different UUIs but the same normalized HomeURI; for 461, the display name was also unchanged. All 483 online UUIs carried a terminal / on HomeURI; most offline records omitted it. Of the 483 online foreign rows, 458 had login timestamps older than one day, 347 older than seven days, and 479 had no matching Presence row. No UUIDs, HomeURIs or personal data were collected in this report.

Root cause and code correction

GatekeeperService.LoginAgent creates the foreign GridUser identity using a HomeURI that commonly ends with /. On disconnect, ActivityDetector asks UserManagementModule.GetUserUUI; the region-normalized HomeURI can omit that slash. GridUserService previously treated these as two different exact database keys and cache entries. Thus logout created a new offline record while leaving the original online record untouched. GridUserService now canonicalizes a fully-qualified foreign UUI to exactly one terminal / on the HomeURI for cache lookup, database lookup and all write operations; bare local UUIDs and different home grids remain separate. The separate foreign display name remains part of the UUI and is not collapsed across avatars.

GatekeeperService now removes only its own temporary Presence when destination lookup, QueryAccess, or CreateAgent fails (including exceptions). It never clears a session already created by the login service. PresenceService.GetAgents no longer considers a RegionID=UUID.Zero preliminary login as an online arrival. HGEntityTransferModule catches a foreign-home-grid logout communication failure, allowing remaining local disconnect event handlers to execute.

Testing and deployment

  • Functional normalization regression: dotnet run --project tools/ci/HGForeignPresenceRegression/HGForeignPresenceRegression.csproj -c Release. This test was first run against the original code and failed specifically on the HomeURI slash mismatch, then passed with the fix.
  • Static lifetime regressions: python3 tools/ci/verify_hg_foreign_presence.py.
  • Full Generation 1 .NET 10 solution build and normal NexVerse CI, especially HomeAgent/Gatekeeper login and standard local login, must remain green.
  • No production data cleanup is included in this PR. It is not safe to blanket-delete Presence or to clear all GridUser.Online rows. Before one-time reconciliation of existing historical duplicates, export a backup, compare canonical identity plus Login/Logout timestamps and region session state, and update only proven stale rows with optimistic compare-and-swap conditions. Never modify a currently logged-in avatar. No direct SQL writes were made during the diagnostic investigation.
  • Optional future maintenance: age-bound invalid RegionID=UUID.Zero presences and stale foreign GridUser entries, but only with durable region/session liveness checks, idempotence and fail-closed race protection.

Tracking: Issue #459.