mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
a92c16debd
createHook() used `options.token ?? ctx.generateNanoid()`, so a nullish token fell back to a generated one but an empty string `""` was accepted verbatim — a meaningless, non-deterministic token that is almost always an accidental value (e.g. an unset variable). Throw a clear error when an explicit empty-string token is passed; `undefined`/`null` still auto-generate, and non-empty strings are unchanged. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
193 B
193 B
@workflow/core
| @workflow/core |
|---|
| patch |
Reject an explicit empty-string token in createHook(). Omit the option (or pass undefined) to get a randomly generated token, or pass a non-empty string.