Skip to content

Recover initial Steam connections across distinct CM servers - #477

Open
intraducine wants to merge 2 commits into
mainfrom
codex/ideck-steam-cm-recovery
Open

intraducine wants to merge 2 commits into
mainfrom
codex/ideck-steam-cm-recovery

Conversation

@intraducine

Copy link
Copy Markdown
Collaborator

Steam sign-in could stop at the first WebSocket handshake failure and leave the failed task and session attached. A new connection now tries at most three distinct CM servers from Valve's directory, cleans up each failed transport, and preserves the last transport error when the server list is exhausted.

Adapted from kuscholar/iDeck at e3d845e, with credit retained in the code and documentation. Explicit certificate failures, offline errors and cancellation stop without retry. URLSession's certificate and hostname checks remain enabled. Errors retain only a known domain and numeric code. Additional guards prevent old messages, old disconnect callbacks and a delayed successful handshake from affecting a replacement or cancelled connection.

The change targets Madeira main's existing native Steam transport and requires no BCD or Playport port. The regression test also runs in CI.

Validation:

  • New deterministic host tests compile the production connection-loop and receive methods with scripted transports and the real CM server-selection code. They cover distinct endpoints, the three-attempt limit, cleanup, health reset, certificate rejection, cancellation, delayed success, replacement connections, stale messages and error redaction.
  • Existing Steam sign-in and library/download tests passed with AddressSanitizer; SteamSession pending-job tests passed.
  • All 100 production Swift files passed the iOS device-target type check.
  • Build reuse, component-cache keys, LLVM cache, clean bootstrap and app-link input checks passed.
  • git diff --check passed.

Live Steam, real TLS/VPN failures, device gameplay and a full IPA build were not tested.

Adapt connection recovery from kuscholar/iDeck at e3d845edd4cf46a247baea6d2cc398d7ba71812d. Retain certificate validation, bound endpoint retries, clean up failed transports, and isolate stale messages and cancelled handshakes. Add deterministic production-method tests and CI coverage.

Signed-off-by: intraducine <265588704+intraducine@users.noreply.github.com>
insertfloppy pushed a commit to insertfloppy/Madeira that referenced this pull request Oct 31, 2026
…aust#501 log move fallback [skip ci]

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LRteDvgrjU8qVByo5Mipwz
Signed-off-by: Claude <noreply@anthropic.com>
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