Skip to content

fix(sandbox): add missing type declarations to SandboxedJob interface#3946

Merged
roggervalf merged 1 commit intotaskforcesh:masterfrom
yogeshwaran-c:fix/sandboxed-job-missing-type-declarations
Apr 8, 2026
Merged

fix(sandbox): add missing type declarations to SandboxedJob interface#3946
roggervalf merged 1 commit intotaskforcesh:masterfrom
yogeshwaran-c:fix/sandboxed-job-missing-type-declarations

Conversation

@yogeshwaran-c
Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Bug fix — aligns TypeScript type declarations with existing runtime behavior.

What is the current behavior?

The SandboxedJob interface is missing type declarations for getChildrenValues, getIgnoredChildrenFailures, and getDependenciesCount. These methods are fully implemented at runtime in wrapJob() (in child-processor.ts) and work correctly via IPC in sandboxed processors, but TypeScript users cannot access them without type assertions like (job as any).getChildrenValues().

Closes #3925

What is the new behavior?

The SandboxedJob interface now includes type declarations for:

  • getChildrenValues<CT = any>() — Returns Promise<{ [jobKey: string]: CT }>, matching the Job.getChildrenValues() signature
  • getIgnoredChildrenFailures() — Returns Promise<{ [jobKey: string]: string }>, matching Job.getIgnoredChildrenFailures()
  • getDependenciesCount(opts?) — Returns Promise<{ failed?: number; ignored?: number; processed?: number; unprocessed?: number }>, matching Job.getDependenciesCount()

The proxy implementations in child-processor.ts also now have explicit return type annotations and type casts for consistency.

Additional context

@roggervalf roggervalf requested a review from Copilot April 8, 2026 03:52
@roggervalf roggervalf force-pushed the fix/sandboxed-job-missing-type-declarations branch from 1183d5c to dbb8ede Compare April 8, 2026 03:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the sandboxed processor TypeScript surface so SandboxedJob’s type declarations match the methods already available at runtime via IPC.

Changes:

  • Adds getChildrenValues, getIgnoredChildrenFailures, and getDependenciesCount to the SandboxedJob interface.
  • Adds explicit return type annotations (and corresponding casts) to the sandbox proxy implementations in ChildProcessor.wrapJob().

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/interfaces/sandboxed-job.ts Extends the public SandboxedJob interface with missing method declarations for dependency/children helpers.
src/classes/child-processor.ts Annotates IPC proxy methods with explicit return types to align with the updated interface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/interfaces/sandboxed-job.ts
Add getChildrenValues, getIgnoredChildrenFailures, and getDependenciesCount
method declarations to the SandboxedJob interface. These methods are already
implemented in wrapJob() and functional at runtime via IPC, but were missing
from the TypeScript interface, forcing users to use type assertions.

Also adds explicit return type annotations and type casts to the corresponding
proxy methods in child-processor.ts for type safety.

Closes taskforcesh#3925
@roggervalf roggervalf force-pushed the fix/sandboxed-job-missing-type-declarations branch from dbb8ede to 804921c Compare April 8, 2026 04:03
@roggervalf roggervalf merged commit 4c6b2b2 into taskforcesh:master Apr 8, 2026
21 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

🎉 This PR is included in version 5.73.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

🎉 This PR is included in version 2.20.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add getChildrenValues and getIgnoredChildrenFailures to SandboxedJob interface

3 participants