Commit 39fbdda
fix(ws): stop discarding parser and handler lookup failures silently
The message handler binding wrapped its whole body in a single try with an
empty catch, so three unrelated failures ended up indistinguishable from a
dropped packet: a custom message parser that throws, a malformed frame, and an
event with no registered handler.
The handler lookup used a non-null assertion followed by a destructure, so an
unrecognised event reached that catch as a TypeError. It is now an explicit
guard that keeps the single map lookup introduced in 8c7718e.
A custom parser that throws is now reported, since nothing else in the process
would reveal it. The default parser stays silent because it throws on
client-controlled input, and reporting that would turn a public socket into a
log flood target.
The catch around the handler invocation is kept on purpose: without it a
synchronous throw propagates through the mergeMap that binds the client and
tears down that client's source stream, silencing every later message from it.
Closes #17624
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent b763af1 commit 39fbdda
1 file changed
Lines changed: 28 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
180 | 181 | | |
181 | | - | |
182 | | - | |
183 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
184 | 191 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
188 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
189 | 211 | | |
190 | 212 | | |
191 | 213 | | |
| |||
0 commit comments