Skip to content

fix(ashby): fail loudly instead of silently dropping malformed socialLinks#5624

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix-ashby-sociallinks-silent-drop
Jul 12, 2026
Merged

fix(ashby): fail loudly instead of silently dropping malformed socialLinks#5624
waleedlatif1 merged 2 commits into
stagingfrom
fix-ashby-sociallinks-silent-drop

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Greptile flagged a real bug on the release PR (staging→main), traced from the ashby.ts array-parsing fix merged in fix(ashby): parse alternateEmailAddresses and socialLinks into arrays before dispatch #5621: parseSocialLinksInput returns [] on any non-JSON-parseable input, and tools.config.params only sets result.socialLinks when the parsed array is non-empty. So malformed socialLinks input (a user typo, or a wand response that didn't follow the JSON-array prompt) silently omits the field entirely — the Ashby candidate.update call proceeds and "succeeds" without applying the requested links, with zero error surfaced to the workflow author.
  • Fixed by throwing a clear error when the string is non-empty but fails to parse into a JSON array, matching the existing throw-on-invalid-JSON pattern already used elsewhere in the codebase (blocks/airtable.ts).
  • Scope note: alternateEmailAddresses (parsed by parseStringListInput) 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

  • Bug fix

Testing

  • Updated 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, unrelated providers/meta/index.ts error confirmed identical on unmodified staging).
  • bunx biome check on 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

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…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).
@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 12, 2026 5:10am

Request Review

@cursor

cursor Bot commented Jul 12, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Narrow change to Ashby block param parsing for update_candidate; only affects workflows that pass invalid socialLinks strings, which previously failed silently.

Overview
Ashby update_candidate social links no longer swallow bad input. parseSocialLinksInput used to return [] on parse failure or non-array JSON, so tools.config.params skipped socialLinks and Ashby updates could succeed without applying links.

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 socialLinks to be omitted silently.

Reviewed by Cursor Bugbot for commit 7456b38. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR makes Ashby social link parsing fail loudly when the input is malformed. The main changes are:

  • Strict parsing for non-empty socialLinks strings.
  • Clear errors for malformed JSON and valid JSON that is not an array.
  • Updated Ashby block tests for the new failure behavior.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/ashby.ts Updated parseSocialLinksInput to throw clear errors for malformed or non-array JSON input.
apps/sim/blocks/blocks/ashby.test.ts Updated tests to cover malformed JSON and non-array JSON social link inputs.

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.
@waleedlatif1 waleedlatif1 merged commit 29cf3e7 into staging Jul 12, 2026
9 checks passed
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

Fixed a check:utils failure — inline error instanceof Error ? error.message : String(error) is a banned pattern; the project enforces getErrorMessage(e, fallback?) from @sim/utils/errors instead. Pushed 7456b3850. Verified bun run check:utils passes.

@waleedlatif1 waleedlatif1 deleted the fix-ashby-sociallinks-silent-drop branch July 12, 2026 05:10
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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.

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.

1 participant