Skip to content

Add getChildrenValues and getIgnoredChildrenFailures to SandboxedJob interface #3925

@hoeeeeeh

Description

@hoeeeeeh

Is your feature request related to a problem? Please describe.
There is a mismatch between the runtime behavior of sandboxed jobs and the public TypeScript interface.

In child-processor.ts, wrapJob() adds getChildrenValues and getIgnoredChildrenFailures to the sandboxed job object. These methods are fully implemented via IPC and handled on the parent side, which means they are available at runtime in sandboxed processors.

However, these methods are not declared in the SandboxedJob interface. As a result, TypeScript users cannot access them without using type assertions, even though they work correctly at runtime.


Describe the solution you'd like
If these methods are intended to be used within sandboxed processors, it would be helpful to include them in the SandboxedJob interface so that the type definitions match the actual runtime behavior.

For example:

getChildrenValues(): Promise<Record<string, any>>;
getIgnoredChildrenFailures(): Promise<Record<string, string>>;

Describe alternatives you've considered

  • Using type assertions such as (job as any).getChildrenValues()
  • Extending the interface locally

However, these approaches reduce type safety and make the supported API surface unclear.


Additional context
These methods are already implemented in wrapJob() and handled in the parent process, so the runtime support already exists.

Aligning the interface with the implementation would improve developer experience and reduce confusion.

If this aligns with the intended API, I would like to open a PR to add these methods to the interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions