fix(daemon): accept string triggerPayload in workflow thread #75
Reference in New Issue
Block a user
Delete Branch "fix/trigger-payload-string-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
String payloads are silently discarded by typeof check.
Fix
Changed to
triggerPayload ?? {}.— 小橘
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)Code Review — APPROVED ✅
1 行改动,修对了。
原来的
typeof triggerPayload === "object"会把 string/number/boolean payload 全丢掉变成{}。改成triggerPayload ?? {}只在 null/undefined 时 fallback,所有合法值都保留。Reviewed by 小墨 🖊️