Skip to content

improvement(sendblue): audit fixes — optional group numbers, seat_id, typing state/duration#5300

Merged
waleedlatif1 merged 5 commits into
stagingfrom
worktree-sendblue-audit
Jun 30, 2026
Merged

improvement(sendblue): audit fixes — optional group numbers, seat_id, typing state/duration#5300
waleedlatif1 merged 5 commits into
stagingfrom
worktree-sendblue-audit

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Comprehensive validate-integration + validate-trigger audit of the Sendblue integration against the live Sendblue API docs. No critical issues — the integration was already clean; these are correctness/completeness fixes.
  • numbers is now optional on Send Group Message (tool + block). Sendblue allows sending to an existing group via group_id alone, so numbers is no longer hard-required; a cleared field is omitted from the request instead of sending [].
  • Added optional seat_id send param to Send Message and Send Group Message — attributes a message to a seat/user (seat UUID or Firebase Auth subject), per docs.
  • Added state (start/stop) and max_duration_ms (1–300000, default 60000) params to Send Typing Indicator, per docs. Number() coercion lives in tools.config.params (not tools.config.tool), with empty/NaN guarded.
  • Normalized empty inbound webhook media_url to null so it matches the "if any" output semantics; aligned the group_id trigger output description to the actual null behavior.
  • Documented why the webhook handler has no verifyAuth: Sendblue's webhook secret header name/scheme is undocumented across all sources, so implementing verification would require guessing. Added TSDoc recording the gap and how to wire it (verifyTokenAuth/createHmacVerifier) once Sendblue documents the scheme.
  • Regenerated integration docs (sendblue.mdx) to reflect the new params.

Type of Change

  • Bug fix / improvement

Testing

Tested manually — tsc --noEmit and biome check clean on all changed files; docs regenerated and verified scoped to Sendblue.

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)

@vercel

vercel Bot commented Jun 30, 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 Jun 30, 2026 11:55pm

Request Review

@cursor

cursor Bot commented Jun 30, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Scoped Sendblue API parity and webhook normalization; no auth or core platform changes beyond clearer group-send validation.

Overview
Aligns the Sendblue integration with the API docs: new optional params, looser group-send rules, and clearer webhook/trigger output semantics.

Send group message no longer requires numbers when group_id targets an existing thread. The block drops the hard requirement and omits empty recipient lists; the tool errors if neither numbers nor group_id is provided.

Send message and send group message accept optional seat_id (seat UUID or Firebase Auth subject) in tools, the workflow block, and generated docs.

Send typing indicator gains state (start/stop) and max_duration_ms (1–300000) with validation in the tool and advanced block fields.

Inbound webhook formatInput maps empty media_url and group_id strings to null; trigger/docs copy now describes group_id as null for non-group messages. TSDoc notes that webhook verifyAuth stays unimplemented until Sendblue documents the secret header scheme.

Adds sendblue.test.ts for trigger matching, idempotency keys, and payload formatting.

Reviewed by Cursor Bugbot for commit bb4ccae. Configure here.

Comment thread apps/sim/blocks/blocks/sendblue.ts
Comment thread apps/sim/blocks/blocks/sendblue.ts
@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates the Sendblue integration to match the current API behavior. The main changes are:

  • Optional group recipients when group_id is provided.
  • Local validation for group-message targets and typing indicator parameters.
  • New seat_id, typing state, and max_duration_ms inputs.
  • Webhook output normalization for empty media_url and group_id values.
  • Regenerated Sendblue docs and added webhook handler tests.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/tools/sendblue/send_group_message.ts Makes numbers optional, adds seat_id, normalizes recipients, and requires either recipients or a non-blank group_id before building the request.
apps/sim/tools/sendblue/send_typing_indicator.ts Adds typing state and max_duration_ms parameters with local checks before the Sendblue request is built.
apps/sim/blocks/blocks/sendblue.ts Updates the Sendblue block inputs and maps optional group recipients, seat attribution, and typing indicator settings into tool parameters.
apps/sim/lib/webhooks/providers/sendblue.ts Normalizes empty Sendblue webhook fields to null and documents the current webhook-auth gap.

Reviews (5): Last reviewed commit: "fix(sendblue): trim and drop blank group..." | Re-trigger Greptile

Comment thread apps/sim/tools/sendblue/send_group_message.ts
Comment thread apps/sim/tools/sendblue/send_typing_indicator.ts
Comment thread apps/sim/tools/sendblue/send_typing_indicator.ts
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/tools/sendblue/send_group_message.ts
@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 116a0bb. Configure here.

@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 89d3885. Configure here.

Comment thread apps/sim/tools/sendblue/send_group_message.ts Outdated
@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 bb4ccae. Configure here.

@waleedlatif1 waleedlatif1 merged commit 604d03e into staging Jun 30, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the worktree-sendblue-audit branch June 30, 2026 23:59
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