Account session recovery journey verification¶
Release status: The account recovery changes were merged in PR #85 and deployed. Isolated Cosmos-backed acceptance and live Google recovery passed, including a check that selecting a second account leaves the first account's puzzle progress isolated. Browser Back returned to the Account page from the provider picker. Production guest smoke checks passed. Recovery after a signed-in production session naturally expires remains pending.
This record maps recovery scenarios to the current regression evidence. Browser tests use a local API fixture and synthetic verified subjects. They do not authenticate with Google or prove the live Google/OIDC configuration. No real provider account, ID, cookie, or secret belongs in this record.
Coverage matrix¶
| Scenario | Test layer and evidence | Result / boundary |
|---|---|---|
| Expiry before loading either game | Playwright e2e/game-recovery.spec.ts; backend expiry boundary tests in PlayEndpointsTests.cs and Games/ReverseCross/ReverseCrossPlayEndpointTests.cs |
Expired identity cannot start or read/write game progress; one eligible recovery action is shown. Local API fixture, not deployed API. |
| Expiry during play and during completion, both games | Playwright e2e/game-recovery.spec.ts expiry-interruption cases; Letter Golf recovery.test.tsx; Reverse Cross persisted-board.test.tsx |
Draft/attempt is retained and completion can resume against authoritative server state. Completion retries do not duplicate Letter Golf attempts; Reverse Cross does not fabricate elapsed time. |
| OIDC cancellation and provider failure | Playwright recovery retry cases; app/api/auth/callback/route.test.ts recovery callback regressions |
Safe actionable retry retains destination and puzzle query. Callback tests mock provider verification; cancellation/failure do not establish live provider behavior. |
| Sign-in resolves to another account | Playwright account-bound draft recovery cases use synthetic verified subject IDs; game component tests assert owner mismatch handling | Draft is isolated to its original subject and mismatched writes are rejected. No actual second Google account was used. |
| Existing completed attempt | Letter Golf recovery.test.tsx and Playwright “trusts a completed server attempt over an older browser draft”; Reverse Cross persisted-board.test.tsx authoritative completed/conflict cases |
Server completion wins; no duplicate submit or re-save of a completed attempt. |
AccountsUi consistency |
app/account/account-visibility-pages.test.tsx; e2e/site-navigation.spec.ts |
Home/menu, Settings, and /account visibility are covered for entitled and hidden states. Browser checks use fixture responses. |
| Mobile | Playwright mobile project, including Pixel 7 viewport checks in account visibility and game recovery specs | Latest browser run: 45 passed, one Pixel 7-specific case intentionally skipped on desktop. Mobile viewport behavior is exercised by the mobile project; this desktop invocation is not mobile-device certification. |
| Pacific midnight / original Daily key | Playwright recovery return URL retains puzzle query; game recovery component coverage and existing Daily-key tests | Original key is retained through the return path; no live midnight transition was performed. Server policy remains authoritative for late completion and streak ordering. |
| Browser storage unavailable | Reverse Cross persisted-board.test.tsx “warns when browser storage cannot retain unsaved placements”; game draft storage unit coverage |
Progress remains in memory and UI does not promise durable browser recovery. |
| Server acknowledgement after completion expiry | Reverse Cross persisted-board.test.tsx retry against full authoritative conflict state; regression changed from no completion to completed without re-saving |
Verified locally: resume follows the server-acknowledged result and does not invent clock time. |
| Duplicate completion after Letter Golf refresh | Letter Golf recovery.test.tsx equivalent server-rendered session refresh regression |
Regression changed from three submit requests to one; completed result remains stable across refresh. |
Local validation snapshot¶
- Backend Release build and the affected backend test set passed: 132 tests. The initial NuGet-advisory restore failure was resolved in the dependency-remediation section below; the final full non-flaky suite passed 1,470 tests with three intentional measurement skips.
- Latest Playwright run passed 45 cases with one intentional desktop skip for the Pixel 7-only
case. The final native Vitest run passed all 934 tests across 103 files with
--maxWorkers=2. An initial four-worker run encountered four worker startup timeouts; the complete two-worker retry passed without increasing test timeouts. Two jsdom navigation messages remain. Earlier frontend totals inaccount-session-recovery.mdare historical snapshots. - Frontend lint, TypeScript checking, and the native production build passed on 2026-11-02.
- Full nested backend solution format verification passed with
dotnet format MiniGamesBackEnd/MiniGamesBackEnd.sln --verify-no-changes --no-restore. The workspace loader emitted a generic warning, with no formatting diagnostics. - Browser console output still includes existing Radix mobile title/description and image warnings; these checks are not a clean-console claim.
- Browser callback tests use mocks and synthetic verified subjects. Live Google/OIDC callback, deployed backend compatibility, and post-deployment smoke checks remain manual release checks.
Initial WSL container verification (2026-11-02)¶
The source was the Windows acct-issues worktree, containing application commit 82153d0
and build-context/protocol commit f05671e; it was not the parked D: optimization checkout.
Rsync used the workspace protocol, receiver-only
local configuration protections, and a private backup below the mirror's excluded .local/.
A checksum dry run after transfer reported no source differences. WSL Docker Engine was 29.7.2.
Commands ran from the respective project directories under /home/justin/repos/minigames:
docker build --progress=plain -t minigames-acct-backend:82153d0 .
docker build --progress=plain --build-arg NEXT_PUBLIC_API_BASE_URL=http://minigames-acct-backend:8080 -t minigames-acct-frontend:82153d0 .
- Backend: blocked. The unmodified Dockerfile failed during
dotnet restore, with NU1902 and NU1903 promoted to errors for transitiveSystem.Security.Cryptography.Pkcs10.0.10. The dependency comes throughMicrosoft.Identity.Web.TokenCache4.14.2. Backend image boot, readiness, and a real frontend/backend container integration run therefore did not happen. - Microsoft lists 10.0.13 as a patched PKCS version in GHSA-846f-f764-76mx and GHSA-2fmv-rv2c-59x7. A trial direct-reference change was reverted: full-solution restore also exposes older XML dependencies in the test/calibration graph, while an explicit web-project XML reference hits framework pruning. Coordinate package and pinned runtime updates, rerun clean restore and container acceptance, and keep vulnerability checks enabled. No dependency change or audit suppression is retained in this branch.
- Frontend: built and booted. Image ID
sha256:1b978aa194aeef5c18dba27f2763fe362ff0adfe17cf8ebae643f299962bbd8f. It ran asnextjs, exposed only local port 43000, and reached Docker health statushealthy./healthreturned HTTP 200. Session endpoint checks passed for guest, expired signed session, marker-only recovery, and fresh verified session; disabled Account visibility returned false. Recovery eligibility used the synthetic E2E API fixture in an isolated sidecar, not Cosmos or the production backend. This proves the packaged BFF boundary, not backend authorization. - A native Chromium check against the running frontend image at the Pixel 7 viewport passed:
the expired-session sign-in action is visible, its URL retains the original Daily key, and
the misleading
Restore puzzleaction is absent. A screenshot was reviewed locally.
Build logs, synthetic smoke scripts, and screenshots are temporary local artifacts, not committed fixtures. Unrelated Docker applications were left running unchanged.
Dependency remediation and backend container rerun (2026-11-02)¶
The initial backend restore failure above is resolved:
- Pin
System.Security.Cryptography.Pkcsto 10.0.14 in the web project. Even Identity.Web 4.16.1's published TokenCache metadata still requests crypto 10.0.10, so a wider Identity.Web upgrade alone would not fix the graph. Keep the existing identity-library version. - Pin
System.Security.Cryptography.Xmlto 10.0.14 in the calibration console project. This also corrects the transitive test graph. The web project uses XML from the ASP.NET shared framework; adding an explicit XML reference there triggers unnecessary-reference pruning. - Pin the Docker runtime to ASP.NET 10.0.14 and SDK to 10.0.403 using verified MCR manifest digests. Package versions are listed on the official PKCS and XML package pages.
- Clean
dotnet restore MiniGamesBackEnd/MiniGamesBackEnd.sln --force-evaluatepassed without warning overrides. Solution Release build passed with zero warnings/errors. Transitive vulnerability audits reported no vulnerable packages for web, tests, or calibration. - All 132 affected account/recovery backend tests passed after rebuilding. Solution formatting verification passed. Frontend sources and their previously recorded validation are unchanged.
After a reviewed rsync from the same Windows worktree, the exact backend Dockerfile built with
docker build --progress=plain -t minigames-acct-backend:crypto-patched .. Image ID:
sha256:cbcf89d2e1e0cbf5c84bdd2ccddf92d8e1452f1e96015436a4ffd77381ad9b34.
The image ran as UID 1654, reported ASP.NET/.NET runtime 10.0.14, reached Docker health status
healthy, and returned HTTP 200 from /health/live. Both games' persistence routes rejected
synthetic expired signed sessions with HTTP 401 / session_expired; recovery eligibility safely
returned false with flags disabled. Tests used a synthetic signing key, Development configuration,
and a loopback-only Cosmos endpoint. No live database or provider was used; database readiness
and successful persistence against Cosmos were not tested. The temporary container was removed.
Broader backend fixture investigation and resolution¶
A full non-flaky backend run was attempted and stopped after multiple older endpoint fixtures
returned HTTP 500. A focused rerun of
PlayerSettingsEndpointsTests.PatchSettings_ValidTheme_Dark reproduced an
ArgumentNullException for signingKey while DI creates CosmosAccountDeletionStore for
the account-deletion middleware. That fixture replaces the player store but supplies neither the
required signing-key configuration nor a fake deletion store. It does not reach the endpoint's
asserted behavior. Another test, GetCommonWords_CanceledRequest_CancelsOnlyCallerWait, timed out.
Those findings prompted a separate fixture fix after the dependency commit:
- Register the existing
InMemoryAccountDeletionStorein endpoint fixtures that still resolved the production Cosmos implementation, including individual export-test factories. Existing deletion-specific fake registrations remain authoritative. Tests no longer need a local signing key or Cosmos connection merely to pass the revocation middleware. - The common-words cancellation test now passes with its original timeout: the missing fixture dependency prevented the request from reaching the provider's start signal.
- Once OpenAPI could be served, its compatibility test detected the new recovery-eligibility
endpoint. Explicitly assert its response contains only the boolean
accountsUi, then exclude that checked addition from the original document fingerprint. Keep the trusted baseline hash unchanged, preserving compatibility checks for the pre-existing contract. - Final native command:
dotnet test MiniGamesBackEnd.Tests/MiniGamesBackEnd.Tests.csproj -c Release --no-restore --filter 'Category!=Flaky'. 1,470 passed, zero failed, three skipped in the non-flaky suite. The skips are the existing opt-in production-catalog measurement cases;Category=Flakyremains excluded as in CI. Full-solutiondotnet format --verify-no-changes --no-restorealso passed. Local TRX output remains under excluded.local/, not in committed fixtures.
No production authentication behavior, test timeouts, or existing compatibility baseline was weakened. These changes affect only tests; the preceding backend/frontend container results remain applicable to the unchanged production code.
Isolated database-backed integration (2026-11-02)¶
The exact backend image recorded above was run against the real Cosmos vNext emulator with HTTPS, gateway mode, and a trusted emulator root certificate. TLS validation remained enabled. Both liveness and Cosmos-backed readiness returned HTTP 200. Seven disposable containers used the partition paths defined by Terraform; no production account, player document, signing key, or database was used. The application remained non-root. See the repeatable setup and runner.
The reviewed scripts/verify-account-recovery-emulator.mjs runner passed all four scenario groups:
- Letter Golf: missing progress returns 404; saves persist; expiry rejects writes with
session_expiredwhile leaving the document and ETag unchanged; a fresh same-player synthetic session restores saved words; another player cannot read them and owner mismatch returns 409. - Reverse Cross: missing progress is
NotStarted; start/save persist; replayed saves are idempotent and stale changes return 409; expiry does not mutate storage; fresh same-player sessions restore the authoritative revision. Completion retries preserve the server's completion timestamp, revision, and accumulated duration. Other players remain isolated. - A synthetic Reverse Cross Daily produces exactly one start, completion, and streak day. Completion retries preserve persisted stats/streaks, and a late board write cannot reopen it.
- A seeded-completed Letter Golf Daily retains its words, score, completed state, document, and ETag when a late autosave arrives. This case does not claim a dictionary-backed Letter Golf submission was executed.
The final runner was syntax-checked and executed successfully after review. An earlier rapid repeat correctly hit the unchanged gameplay rate limiter (HTTP 429); the successful final run was made after its window cleared. The runner refuses redirects and requires an explicit isolated-emulator acknowledgement. It creates fresh synthetic subjects on each invocation and prints only aggregate PASS messages. Its manually signed sessions test persistence boundaries, not OIDC authentication. Emulator auth/RBAC and RU limitations remain separate from Azure target-environment acceptance.
Live Google acceptance preparation (2026-11-02)¶
Live Google federation had already worked in production during the original incident diagnosis. This preparation tests whether the current branch can be exercised locally without deployment:
- Read the existing Terraform-managed local BFF credential outputs without changing state or
cloud configuration. The credential successfully acquired a token containing the required
Internal.IdentityLinkapp role. Read the deployed API's public AzureAd validation settings for the isolated backend; the backend still uses the disposable local database. - CIAM discovery succeeded with issuer validation. A native Windows browser preflight from
http://localhost:3000/api/auth/start?returnTo=%2Fsettingsrendered the configured CIAM sign-in page and reached Google's sign-in page. No account credentials were entered and no provider callback was completed. Reaching this page is readiness evidence, not proof of recovery or a complete callback allowlist check. - The native Windows frontend runs this worktree on loopback port 3000 and calls the WSL
backend at local port 45236. Local
AccountsUiis enabled only for this isolated backend. Provider credentials remain in excluded, protected local configuration; they are not baked into images, committed, or copied into the disposable database fixtures. - No authorized Android device was connected at preflight. A private browser on this laptop
can start the controlled test now. If using a phone, connect/authorize it and arrange local
port forwarding before starting; the phone's own
localhostotherwise points to itself.
The controlled initial Google sign-in completed successfully: the user returned to local Settings, which displayed Signed in and the Google method. An independent read of the disposable Cosmos database confirmed one canonical provider-linked local account and one external identity. A private, excluded baseline records the canonical owner and an identity fingerprint for comparison after recovery; no account identifiers, provider claims, or cookies are committed. This proves the actual initial provider callback and persistence handoff, not expired-session recovery yet.
Live same-account recovery result¶
The user started the synthetic Reverse Cross Daily and placed only AB across its top row. An independent Cosmos point read confirmed that unfinished attempt belonged to the canonical local account, with the expected Daily key, one placement, board revision 1, and an active server clock anchor. A private baseline captured the persisted play before expiry.
A temporary loopback-only helper validated that browser's signed local session and canonical owner, then expired only its local app session and set the bounded recovery marker. The helper never loaded production credentials and could not establish a new authenticated session. Its one-time action was observed as consumed; it was stopped after use. The user saw the expired notice, followed the ordinary game's sign-in action, and returned to the in-progress puzzle.
Post-recovery checks passed:
- The canonical owner and linked external identity fingerprint match the original local account.
- The entire saved play document is unchanged: same owner, Daily key, AB placement, revision, server clock anchor, and unfinished state. Recovery did not reset the Daily clock.
- Private server logs contain both initial and recovery provider callbacks. Raw callback URLs, authorization codes, cookies, identifiers, and provider claims remain outside committed docs.
The user did not see another Google account picker. The app's ordinary /api/auth/start route
does not force a prompt, so the provider can reuse its still-active SSO session while the app
validates the new authorization callback. Account switching separately requests select_account;
see Microsoft's prompt behavior.
App-session expiry does not imply that the provider's own session has expired.
Expired-state UI follow-up¶
The observed expired state was visually empty. Reverse Cross now reuses its decorative puzzle
skeleton without pulsing, keeps the recovery message/action centered, and conceals the real board
and gameplay controls. Clock synchronization stops while identity is expired; pending drafts
remain intact. The recovery destination and AccountsUi gating are unchanged.
Validation: 85 focused component tests and the full frontend suite (935 tests across 103 files) pass; frontend lint, TypeScript, and native production build pass. Native Chromium at 430 by 760 verified the static placeholder, one recovery action, no real word/start controls, and no horizontal overflow. A fresh in-progress page also loaded the saved board without page errors or the hook dependency-size warning. That warning appeared in the user's already-open development tab while Fast Refresh applied an edit adding an effect dependency; it did not reproduce on a fresh load. Local screenshots are excluded artifacts.
After syncing the active Windows worktree, the updated frontend Dockerfile also built through
WSL from application commit 064acb3, using the local acceptance-only API override
http://localhost:8082. Image ID:
sha256:16b9181af57349152e75427ea9e49f9dae55c98954f9b8a81a8ff8e8b2d461a0.
It booted as nextjs, returned HTTP 200 from /health, and projected the expired session with
recovery enabled through the actual isolated backend. This image used only a synthetic signing
key; Google acceptance continued on the native Windows frontend, not this container. The
temporary frontend smoke container was removed after verification.
On 2026-11-03, the account picker returned a second Google identity to the November 2 Daily. The UI showed Ready to play at 0:00. Cosmos confirmed separate accounts and no attempt for the second account. The original account retained AB and its unfinished attempt. Its revision advanced from 1 to 2 with pause-related timing fields changed, consistent with automatic pause when the tab is hidden. This run verified saved-play isolation. Draft and pending-write isolation remain covered by automated checks.
On 2026-11-03 in Bogota, the provider picker offered no Cancel button. Browser Back returned the user to Account, and both the explicit November 2 Daily URL and the bare game URL opened. The backend still served the November 2 Daily at 23:02 Pacific Standard Time. This verifies browser abandonment. The provider cancellation callback and its retry notice remain open. Do not expire a production cookie to manufacture those local tests. Keep the dedicated local services running only while the controlled test needs them, then remove them as documented.
Manual release checks¶
- In a controlled test environment, sign in with the configured Google provider after session expiry; verify the canonical account is restored and the original puzzle URL is retained.
- Cancel provider sign-in and induce a safe callback/prepare failure; verify the prior identity is unchanged and an actionable notice appears at the return destination.
- Repeat with a separate controlled provider account and verify no draft or pending write crosses account boundaries. Do not record provider identifiers in test artifacts.
- Verify both games before load, during play, and during completion; include an already completed attempt, blocked storage, and a recovery crossing Pacific midnight.
- Confirm home/menu, Settings, and
/accountfollow the sameAccountsUidecision on the target deployment, including feature-disabled direct routes. - Complete container build and boot smoke checks from the active worktree; commands, results, and artifact provenance are recorded above. Database-backed container integration remains a separate target-environment check.
- Resolve the broader backend fixture failures and rerun the full non-flaky suite.
- Exercise the real Cosmos stores against an isolated HTTPS emulator, including persistence, ETags/revisions, account isolation, and completed-Daily/stat protection.