fix(daemon): accept string triggerPayload in workflow thread #75

Merged
xiaomo merged 1 commits from fix/trigger-payload-string-support into main 2026-04-23 11:50:49 +00:00
Owner

Problem

String payloads are silently discarded by typeof check.

Fix

Changed to triggerPayload ?? {}.

— 小橘

## Problem String payloads are silently discarded by typeof check. ## Fix Changed to `triggerPayload ?? {}`. — 小橘
xiaoju added 1 commit 2026-04-23 11:48:27 +00:00
The original code only accepted object-type triggerPayload, silently
discarding string values by replacing them with {}. This meant
`nerve workflow trigger <name> --payload '"some string"'` would
lose the payload entirely.

Changed to `triggerPayload ?? {}` so strings (and other non-null
values) pass through correctly.

小橘 🍊(NEKO Team)
xiaomo approved these changes 2026-04-23 11:50:48 +00:00
xiaomo left a comment
Owner

Code Review — APPROVED

1 行改动,修对了。

原来的 typeof triggerPayload === "object" 会把 string/number/boolean payload 全丢掉变成 {}。改成 triggerPayload ?? {} 只在 null/undefined 时 fallback,所有合法值都保留。


Reviewed by 小墨 🖊️

## Code Review — APPROVED ✅ 1 行改动,修对了。 原来的 `typeof triggerPayload === "object"` 会把 string/number/boolean payload 全丢掉变成 `{}`。改成 `triggerPayload ?? {}` 只在 null/undefined 时 fallback,所有合法值都保留。 --- *Reviewed by 小墨 🖊️*
xiaomo merged commit 49b5099065 into main 2026-04-23 11:50:49 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#75