fix(ashby): fail loudly instead of silently dropping malformed socialLinks#5624
Conversation
…Links parseSocialLinksInput returned [] for any non-JSON-parseable input, and tools.config.params only sets result.socialLinks when the parsed array is non-empty — so a malformed socialLinks string (user typo, or a wand response that didn't follow the JSON-array prompt) silently omitted the field entirely. The Ashby candidate.update call then succeeded without applying the requested links, with no error surfaced to the workflow author. Throw a clear error instead, matching the existing throw-on-invalid-JSON pattern used elsewhere (e.g. blocks/airtable.ts).
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Malformed JSON now throws with a message that includes the parse error and an example array shape. Valid JSON that is not an array throws a separate expected a JSON array error. Empty or whitespace-only strings still yield no field, unchanged. Tests expect throws for garbage input and for a single object JSON value instead of expecting Reviewed by Cursor Bugbot for commit 7456b38. Configure here. |
Greptile SummaryThis PR makes Ashby social link parsing fail loudly when the input is malformed. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "fix(ashby): use getErrorMessage instead ..." | Re-trigger Greptile |
…ction check:utils bans the e instanceof Error ? e.message : fallback pattern in favor of getErrorMessage(e, fallback?) from @sim/utils/errors.
|
Fixed a check:utils failure — inline |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7456b38. Configure here.
Summary
parseSocialLinksInputreturns[]on any non-JSON-parseable input, andtools.config.paramsonly setsresult.socialLinkswhen the parsed array is non-empty. So malformedsocialLinksinput (a user typo, or a wand response that didn't follow the JSON-array prompt) silently omits the field entirely — the Ashbycandidate.updatecall proceeds and "succeeds" without applying the requested links, with zero error surfaced to the workflow author.blocks/airtable.ts).alternateEmailAddresses(parsed byparseStringListInput) doesn't have this problem the same way — it falls back to comma-splitting rather than failing outright, so it degrades gracefully for non-JSON input instead of silently vanishing. Left unchanged.Type of Change
Testing
apps/sim/blocks/blocks/ashby.test.ts: malformed JSON now throws with a clear message; a valid-but-non-array JSON value (e.g.{"type":"Twitter"}) also throws (8 tests total, all passing).bunx turbo run type-check --filter=sim --force— clean (one pre-existing, unrelatedproviders/meta/index.tserror confirmed identical on unmodified staging).bunx biome checkon touched files — clean.bun run apps/sim/scripts/check-block-registry.ts origin/staging— no subblock changes, all checks pass.bun run check:api-validation— passes.Checklist