Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[TRI-5140] The metadata.set function doesn't work when used inside a JS class #1904

Copy link
Copy link
@matt-aitken

Description

@matt-aitken
Issue body actions

These calls don't actually update the metadata of the root run. The same calls work not inside a class.

import { metadata } from '@trigger.dev/sdk/v3';

export class DummyClass {
  async doSomethingAsync() {
    metadata.root.set('dummy1-async', 'foo');
    metadata.root.set('dummy2-async', 'bar');
    metadata.root.set('dummy3-async', 123);
  }

  doSomethingSync() {
    metadata.root.set('dummy4-sync', 'baz');
    metadata.root.set('dummy5-sync', 456);
  }
}

There's a reproduction repo here: https://github.com/Yoshify/trigger-repro-app/blob/main/src/trigger/example.ts

Thanks to @Yoshify for this repro

TRI-5140

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.