07df5129

By: Tom Sydney Kerckhove <syd@cs-syd.eu>

JSONLD: tolerate unescaped control characters in script bodies

Some sites emit literal newlines (and other control characters) inside
JSON string values in their ld+json scripts, which is invalid JSON that
JSON.decode rejects, causing the whole event to be silently dropped.

Escape control characters and re-try decoding. This is a pure repair:
valid JSON never contains raw control characters inside a string, so it
is a no-op on well-formed input and only ever rescues otherwise
unparseable input.

Suite timing

Time to Start Worker time Duration Time to finish Idle
Config 6s 2s 2s 9s 6s
Eval 9s 1m10s 1m10s 1m20s 0s
Build 13m28s 27s 28s 13m57s 12m09s
Suite 6s 1m40s 13m50s 13m57s 12m16s

Timeline

0s10s20s30s40s50s1m1m10s1m20s13m30s13m40s13m50s