# fix\(server\): WS handler layer keeps typed requirements past \~200 RPCs · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/ba593c8ca3686c36c5cfe16d44799ee69a0f56c6)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: ba593c8ca3686c36c5cfe16d44799ee69a0f56c6

Requested commit: ba593c8ca3686c36c5cfe16d44799ee69a0f56c6

Commit: ba593c8ca3686c36c5cfe16d44799ee69a0f56c6

Tree: 34f1f07c820bcefbfdcff599ef41b2adcff87d5c

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
fix(server): WS handler layer keeps typed requirements past ~200 RPCs

RpcGroup.toLayer types each handler's requirements by scanning every RPC in
the group, so the cost grows with handlers x RPCs. Near 200 WebSocket methods
it crossed TypeScript's instantiation limit, the layer's requirements fell
back to `any`, and typecheck failed (TS2589 / TS377030).

Register the handlers through two disjoint groups built from the same
middleware-wrapped RPCs, which halves the cost. Handler behavior, contracts,
and the layer's requirement, error, and output types are unchanged.

Fixes #22364

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

```

## Parents

- [044f07257c9684ae4543bd1e1ebf9c394e9e3830](https://git.cafe/pingdotgg/t3code/commit/044f07257c9684ae4543bd1e1ebf9c394e9e3830?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/ba593c8ca3686c36c5cfe16d44799ee69a0f56c6?format=markdown)
