trigger.dev
trigger.dev copied to clipboard
[TRI-5231] bug: Replaying in the dashboard and modifying an `undefined` value in the payload doesn't work
If your original payload (coming from an SDK call you made) looks like this:
{ "foo":"bar","someKey": undefined }
You can’t use undefined in JSON but we use SuperJSON in the SDK so you can use Dates, undefined, Map and Set.
When you replay we show only valid JSON in the editor (our current editor doesn’t support SuperJSON). So it doesn't show someKey: undefined. In a lot of languages undefined and missing are the same, but not in JavaScript.
So if in the Replay editor you set this:
{ "foo":"bar","someKey": true }
But the payload of the run will actually be:
{ "foo":"bar","someKey": undefined }
This is a bug with editing a SuperJSON value that was already present in the original payload.
From SyncLinear.com | TRI-5231