You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(o11y): prevent oversized cy.task payloads instead of switching dispatch [SDK-7399]
Replaces the earlier cy.now approach, which was wrong: cy.now('task', ...) throws on
Cypress 14 in every context (test body, mocha hook and Cypress.on listener), verified on a
remote Windows terminal, so it stopped the skipping only by never delivering anything.
Browser-side telemetry silently disappeared from the dashboard.
Dispatch therefore stays on cy.task, which does deliver. Since cy.task enqueues, its
failure surfaces after the enqueue call returns and cannot be caught at the call site --
so the protection is to never build a payload that fails.
Measured on a remote Windows terminal, single event per afterEach:
64KB pass 128KB pass 256KB pass 512KB pass 768KB pass
1MB FAIL 8MB FAIL
Event count is not a factor: 10, 100 and 1000 small events all pass. The limit is a hard
ceiling near 1MB per cy.task payload.
sanitizeForTask now caps the serialized payload at 128KB: individual strings longer than
8KB are truncated first (command args are the realistic source of bulk), and the event is
skipped only if it is still too large. Skips are logged rather than silent.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments