diablo2-web/tests/client
troytt e623e992dc fix(client): return to the login screen with a 1.13c reason on session loss
OnlineSession duck-typed a flow onError hook that does not exist, so pre-game
losses never propagated; a failed login left a half-dead flow in place, and
main.ts only routed in-game disconnects (to a dead lobby). Concurrent login
attempts (LOG IN, ACCOUNT SETTINGS and Enter all call onLogin) replaced each
other's flow, leaving char_create bound to a flow without MCP.

- OnlineSession.handleSessionLost is the single, idempotent end of a session:
  disposes the game adapter and the flow (all sockets/timers), records the
  reason, enters `disconnected` and notifies onSessionLost/onDisconnect once.
  Flow loss events, D2GS adapter close, in-game client errors and disconnect()
  all route through it.
- Pre-game operations (create/delete/convert/select character, list games,
  enter game, lobby chat) run via lobbyOp: no session -> not_connected loss,
  failure caused by the loss -> SessionLostError; status errors stay on screen.
- Reasons use ENG 1.13c tbl text plus the technical detail: string#5352
  (BNCS lost), string#5357 (realm/game interrupted), string#5349 (timeout),
  string#5353 / patchstring#1066 (connect failed), string#5351 (not
  connected).
- main.ts: one onSessionLost handler -> returnToLoginAfterSessionLoss (keeps
  the typed account name, clears roster/game state); catch blocks ignore
  SessionLostError; onLogin allows one attempt at a time; no bnet_lobby
  routing for dead sessions. The login screen wraps long reasons.

TAG=agy
CONV=109a3012-103a-42f0-8ae1-bbc0857047ef
2026-10-01 12:02:30 +00:00
..
client-world.test.ts fix(client): neutral not-ready HUD state and server-authoritative HUD commands (P1/P2) 2026-10-01 01:41:13 +00:00
derived-stats.test.ts fix(client): table-driven missile ids and derived character stats (P3) 2026-10-01 01:41:13 +00:00
drlg-map-motion.test.ts refactor: split into isolated common/netproto/server/client/baker modules 2026-10-01 00:10:18 +00:00
gamble-replay-ui.test.ts test(client): capture-backed gamble flow (fixture 09, Gheed) 2026-10-01 11:09:54 +00:00
hud-server-authority.test.ts fix(client): neutral not-ready HUD state and server-authoritative HUD commands (P1/P2) 2026-10-01 01:41:13 +00:00
hud-session-play.test.ts fix(netproto): detect BNCS/MCP/D2GS session loss centrally in D2OnlineFlow 2026-10-01 12:02:30 +00:00
missile-id-map.test.ts fix(client): table-driven missile ids and derived character stats (P3) 2026-10-01 01:41:13 +00:00
session-lost-login.test.ts fix(client): return to the login screen with a 1.13c reason on session loss 2026-10-01 12:02:30 +00:00
settings-toolbar-view.test.ts refactor(client): remove leftover single-player client code 2026-10-01 06:03:55 +00:00
spawn-position-539.test.ts test(#539): take the town waypoint from its server UnitAssign anywhere in the capture 2026-10-01 11:36:30 +00:00
transaction-cost-input.test.ts feat(client): price server items with the 1.13c #10107/#10071 port 2026-10-01 10:29:07 +00:00
vendor-stash-replay.test.ts feat(client): server-driven NPC/stash interaction state in ClientWorld 2026-10-01 10:08:43 +00:00
vendor-stash-ui.test.ts feat(client): server-driven vendor, repair, stash-gold and gamble UI 2026-10-01 11:09:53 +00:00