AyCode.Core/AyCode.Services/docs/SIGNALR_TODO.md

2.2 KiB

SignalR — TODO

Priority legend

  • P0 blocker · P1 important · P2 nice-to-have · P3 idea

TODO-01: Diagnose first-call null in PostDataAsync

Priority: P2 · Type: Investigation · Related: SIGNALR_ISSUES.md#issue-02

Reproduce the GetProductDtos_80-style first-call null. Add trace logs to PostDataAsync<T> awaiter path and OnReceiveMessage → pending request dictionary lookup. Verify requestId → Task<T> correlation on the very first chunked response of a fresh connection.

TODO-02: Document asymmetric send/receive capability

Priority: P1 · Type: Docs

Current behaviour: sender selects BinaryProtocolMode independently; receiver detects the wire format from the first byte (CHUNK_START=200 → chunked path; else non-chunked). This means client and server can run DIFFERENT ProtocolMode settings independently — a core feature amplifying interoperability.

Document in SIGNALR_BINARY_PROTOCOL.md as a dedicated "Asymmetric send/receive contract" section. Key selling points:

  • WASM client + AsyncSegment server → works (WASM downgrades send, receives chunked happily)
  • Third-party client on NuGet can pick any mode → server doesn't care
  • Gradual mode rollouts possible (no synchronized deploy)

TODO-03: Code-level guard for FlushTimeout < ClientTimeoutInterval

Priority: P2 · Type: Feature

AcBinaryHubProtocolOptions.Validate() currently documents (in XML doc) that FlushTimeout should be less than the SignalR HubOptions.ClientTimeoutInterval, but there is no code-level check. Add validation at protocol registration time — if both options are resolvable from the DI scope, verify the constraint and emit a startup warning (or throw, pending decision).

TODO-04: BinaryProtocolMode.Auto — adaptive send-mode

Priority: P3 · Type: Feature · Related: SIGNALR_BINARY_PROTOCOL_TODO.md#todo-03

Design: on first received message, inspect first byte to determine peer's send format. On subsequent sends, match it (subject to local-platform constraints, e.g. WASM never actually sends AsyncSegment). Per-HubConnection state. Optional upfront handshake-extension negotiation as an alternative — see wire-level TODO.