Skip to content

[Server] Fail loudly when a transport is used without Protocol::connect() - #52

Open
chr-hertel wants to merge 1 commit into
mainfrom
cleanup/transport-connect-guard
Open

[Server] Fail loudly when a transport is used without Protocol::connect()#52
chr-hertel wants to merge 1 commit into
mainfrom
cleanup/transport-connect-guard

Conversation

@chr-hertel

Copy link
Copy Markdown
Owner

Extracted slice from #9 (closed): fail loudly when a transport is used without Protocol::connect().

  • BaseTransport's callback accessors now throw LogicException instead of silently returning []/null/doing nothing when the protocol callbacks were never wired (message handling, outgoing messages, pending requests, response finder, fiber yield).
  • handleSessionEnd() stays tolerant: it is a teardown notification also reached via close() on error paths, where throwing would mask the original failure.
  • Inlined the single-use ManagesTransportCallbacks trait into BaseTransport and dropped InMemoryTransport's redundant onMessage() override.

Confidence: 9/10 — small, fully covered by new unit tests; whole unit suite, cs-fixer and PHPStan green.

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