Skip to content

fix(auth): reuse a fresh Xbox Live token chain at PLAY instead of refetching it - #254

Open
xRookieFight wants to merge 1 commit into
Wyze3306:mainfrom
xRookieFight:fix/reuse-cached-xbl-preauth-at-launch
Open

fix(auth): reuse a fresh Xbox Live token chain at PLAY instead of refetching it#254
xRookieFight wants to merge 1 commit into
Wyze3306:mainfrom
xRookieFight:fix/reuse-cached-xbl-preauth-at-launch

Conversation

@xRookieFight

Copy link
Copy Markdown

Summary

  • PLAY re-ran the full device/user/XBL/XSTS/SISU chain (eight sequential HTTP round trips) on every launch, even right after _warm_xbox_preauth had just minted the same tokens with hours of validity left — about 10s of every launch's wait spent redoing work that was already done.
  • xbl_preauth now reuses the cached online payload when it still clears a 30-minute margin, and only re-runs the chain once that margin is gone (or the cache is missing/stale), so a warm background sign-in actually gets used at PLAY.
  • The offline-resilience fallback (a network failure mid-refresh falling back to a still-valid cache) is untouched — it still uses its own thin 60s margin.

Test plan

  • python -m pytest tests/test_auth_settings.py tests/test_auth_errors.py -q — added two new tests: a fresh cache skips the network entirely, and a cache below the reuse margin still drives a real refresh.
  • python -m pytest tests/ -q — full suite passes (one pre-existing, unrelated failure on this machine from a missing rpm CLI, reproduced on main).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant