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

[TRI-2755] v3 run log outputs with empty array inside objects aren't shown

Open matt-aitken opened this issue 1 year ago • 1 comments

This task:

export const myTask = task({
  id: 'some-id',
  run: async () => {
    return {
      hooks: [],
    };
});

Has the correct output:

{
  "hooks": [],
}

But in the log data/on the run page is shows just an empty object. This is a bug with the flattenAttributes/unflattenAttributes code we use with our OpenTelemetry pipeline.

TRI-2755

matt-aitken avatar Jun 21 '24 15:06 matt-aitken

This is pretty annoying, is there a good fix for this? I've been having to JSON.stringify all my objects just so I can look at the arrays

edit: tried my hand at a fix, not sure I have enough context to fully understand all that uses the serialization

PaulBGD avatar Mar 29 '25 18:03 PaulBGD