Commit 925322f
fix(observability): address PR review — make command:enqueued resilient and skip unserializable events [SDK-6016]
Review feedback on #1118:
- command:enqueued (log) path called JSON.stringify directly, so a
non-circular serialization failure (BigInt, throwing toJSON, Proxy
trap) could still throw uncaught and abort the run. Route it through
sanitizeForTask, which is try/catch-guarded.
- sanitizeForTask's catch returned { serializationError } and forwarded
it to cy.task, sending a malformed payload to the Node o11y handler.
Return null as a "skip this event" sentinel instead; flush sites guard
on it and drop the event rather than ship a malformed one.
Net effect: graceful degradation is now total across all three sites —
no crash, and no malformed event reaches the collector.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 28af664 commit 925322f
1 file changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | | - | |
33 | | - | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
236 | 242 | | |
237 | 243 | | |
238 | 244 | | |
239 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
240 | 251 | | |
241 | 252 | | |
242 | 253 | | |
| |||
337 | 348 | | |
338 | 349 | | |
339 | 350 | | |
340 | | - | |
| 351 | + | |
| 352 | + | |
341 | 353 | | |
342 | 354 | | |
343 | 355 | | |
| |||
352 | 364 | | |
353 | 365 | | |
354 | 366 | | |
355 | | - | |
| 367 | + | |
| 368 | + | |
356 | 369 | | |
357 | 370 | | |
358 | 371 | | |
| |||
0 commit comments