Skip to content

Ignore invalid step IDs when inserting or replaying tasks#3735

Merged
mnafees merged 2 commits intomainfrom
nafees/filter-invalid-tasks
Apr 28, 2026
Merged

Ignore invalid step IDs when inserting or replaying tasks#3735
mnafees merged 2 commits intomainfrom
nafees/filter-invalid-tasks

Conversation

@mnafees
Copy link
Copy Markdown
Member

@mnafees mnafees commented Apr 27, 2026

Description

Fixes a nil pointer panic when a batch of tasks includes an invalid step ID.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@mnafees mnafees self-assigned this Apr 27, 2026
Copilot AI review requested due to automatic review settings April 27, 2026 08:30
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hatchet-docs Ready Ready Preview, Comment Apr 27, 2026 9:58am

Request Review

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

Fixes a nil-pointer panic in task creation/replay flows by skipping tasks whose StepId no longer exists (e.g., step deleted) before building per-step configuration-dependent fields.

Changes:

  • Filter out CreateTaskOpts with missing StepId before calling insertTasks.
  • Filter out ReplayTaskOpts with missing StepId before proceeding with replay logic (and log a warning when skipped).
Comments suppressed due to low confidence (1)

pkg/repository/task.go:2395

  • The error wrap message here says "failed to get step expressions" but the call is to getConcurrencyExpressions. This makes debugging misleading; update the message to reference concurrency expressions (and keep wording consistent with insertTasks).
	concurrencyStrats, err := r.getConcurrencyExpressions(ctx, tx, tenantId, stepIdsToConfig)

	if err != nil {
		return nil, fmt.Errorf("failed to get step expressions: %w", err)
	}

Comment thread pkg/repository/task.go
@mnafees mnafees merged commit a928781 into main Apr 28, 2026
52 checks passed
@mnafees mnafees deleted the nafees/filter-invalid-tasks branch April 28, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants