Provide environment information
System:
OS: macOS 13.5.2
CPU: (8) x64 Apple M1 Pro
Memory: 12.33 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
npm: 10.1.0 - ~/.nvm/versions/node/v18.16.0/bin/npm
pnpm: 8.7.6 - ~/.nvm/versions/node/v18.16.0/bin/pnpm
Watchman: 2023.08.14.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 117.0.5938.88
Safari: 16.6
npmPackages:
@tanstack/react-query: 5.0.0
@trpc/client: next
@trpc/next: next
@trpc/react-query: next
@trpc/server: next
next: ^13.4.8 => 13.5.1
react: ^18.2.0 => 18.2.0
typescript: ^5.1.3 => 5.2.2
Describe the bug
tRPC subscriptions do not automatically resume if the server unexpectedly closes the connection.
This can happen because of various reasons
- WAF such as Cloudflare will close websocket connections after 100 seconds
- NGINX will do the same if
proxy_read_timeout is set
Looks like there's a regression in the #4959
Link to reproduction
https://github.com/avarayr/trpc-ws-subs-regression
To reproduce
- Clone reproduction repository
npm install
npm run dev
- Go to
https://127.0.0.1:3000
- Observe the subscription doesn't restart if the server closes the socket.
Additional information
No response
👨👧👦 Contributing
Provide environment information
System:
OS: macOS 13.5.2
CPU: (8) x64 Apple M1 Pro
Memory: 12.33 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v18.16.0/bin/yarn
npm: 10.1.0 - ~/.nvm/versions/node/v18.16.0/bin/npm
pnpm: 8.7.6 - ~/.nvm/versions/node/v18.16.0/bin/pnpm
Watchman: 2023.08.14.00 - /opt/homebrew/bin/watchman
Browsers:
Chrome: 117.0.5938.88
Safari: 16.6
npmPackages:
@tanstack/react-query: 5.0.0
@trpc/client: next
@trpc/next: next
@trpc/react-query: next
@trpc/server: next
next: ^13.4.8 => 13.5.1
react: ^18.2.0 => 18.2.0
typescript: ^5.1.3 => 5.2.2
Describe the bug
tRPC subscriptions do not automatically resume if the server unexpectedly closes the connection.
This can happen because of various reasons
proxy_read_timeoutis setLooks like there's a regression in the #4959
Link to reproduction
https://github.com/avarayr/trpc-ws-subs-regression
To reproduce
npm installnpm run devhttps://127.0.0.1:3000Additional information
No response
👨👧👦 Contributing