trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

[TRI-5231] bug: Replaying in the dashboard and modifying an `undefined` value in the payload doesn't work

Open matt-aitken opened this issue 9 months ago • 0 comments

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

matt-aitken avatar Apr 23 '25 10:04 matt-aitken