Skip to content

fix: handle empty payloads in scheduled task test page (#3316)#3382

Closed
avasis-ai wants to merge 1 commit intotriggerdotdev:mainfrom
avasis-ai:fix/scheduled-task-empty-payload-crash-3316
Closed

fix: handle empty payloads in scheduled task test page (#3316)#3382
avasis-ai wants to merge 1 commit intotriggerdotdev:mainfrom
avasis-ai:fix/scheduled-task-empty-payload-crash-3316

Conversation

@avasis-ai
Copy link
Copy Markdown

Summary

Fixes #3316

In TestTaskPresenter.server.ts, getScheduleTaskRunPayload calls parsePacket which returns undefined when the payload data is empty (e.g. ""). The function then accesses .timezone on undefined, throwing a TypeError that crashes the test page presenter.

Fix: Add a null guard after parsePacket — when the result is falsy, return a failed SafeParse-compatible result ({ success: false }). This causes the run to be filtered out by the existing .filter(Boolean) on line 355 and the template check on line 368, so the test page loads normally.

Changes

  • apps/webapp/app/presenters/v3/TestTaskPresenter.server.ts: Added early return in getScheduleTaskRunPayload when parsePacket returns undefined

Testing

  • Manual verification: empty-payload runs (payload="", payloadType="application/json") are skipped without crashing
  • Standard task runs and scheduled tasks with valid payloads are unaffected

…#3316)

When parsePacket returns undefined for empty data (e.g. payload=''),
getScheduleTaskRunPayload crashes accessing .timezone on undefined.
Add a null guard that returns a failed SafeParse result so the run is
gracefully skipped by the existing filter(Boolean) logic.
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

⚠️ No Changeset found

Latest commit: 83099b9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

Hi @avasis-ai, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions bot closed this Apr 15, 2026
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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.

bug: Scheduled task test page crashes when previous runs have empty payloads

2 participants