feat(linq): audit fixes + native auto-registering webhook trigger#5301
Conversation
Tools/block audit (validated against the live Linq partner API + OpenAPI spec): - create_chat: read the sent message from top-level response.message (was always null) - get_message/edit_message: expose canonical deliveryStatus; mark is_delivered/is_read deprecated - send_message: fall back to from_handle.service/preferred_service for service output - list_phone_numbers: migrate deprecated health_status to reputation; add forwardingNumber; guard JSON parse - check_imessage/check_rcs: guard response.json() parse - mark_chat_read: note 1:1-only / group no-op behavior Native webhook trigger (auto register + deregister): - 6 triggers (message received/delivered/failed/read, reaction added, all-events) - Standard Webhooks signature verification (HMAC-SHA256, whsec_ secret) - createSubscription/deleteSubscription manage the Linq subscription lifecycle - event_id idempotency; full 27-value WebhookEventType enum for all-events - regenerated docs
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Implements a Linq webhook provider that verifies Standard Webhooks signatures (HMAC-SHA256, clock skew), maps payloads to trigger inputs, deduplicates on Linq tool outputs are aligned with the current API: canonical Reviewed by Cursor Bugbot for commit 1f8c0ef. Configure here. |
Greptile SummaryThis PR updates the Linq integration with audited tool fixes and native webhook triggers. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (4): Last reviewed commit: "fix(linq): mark nullable list_webhook_su..." | Re-trigger Greptile |
…veryStatus enum doc Final validation against the raw Linq OpenAPI spec confirmed the sent message is at chat.message (CreateChatResult exposes only chat), so the data.message fallback was dead code. Also list all 7 DeliveryStatus values in the send_message output description.
…, nullable forwardingNumber Review + final pre-merge audit fixes: - Trigger apiKey/phoneNumbers subblocks collided with the block's tool apiKey state key — rename to triggerApiKey/triggerPhoneNumbers (per the namespacing rule from #2133) and read them in the webhook handler - edit_message: the API returns 204 No Content when editing an already-deleted message; guard the empty body instead of throwing on response.json() - list_phone_numbers: mark forwardingNumber output nullable (returns null) - check_rcs: tighten address hint (RCS is phone-only, not email) - regenerated docs
|
@cursor review |
deleteSubscription still read config.apiKey after the credential rename, so undeploy would skip the DELETE and orphan the Linq subscription. Match createSubscription's triggerApiKey key.
|
@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 8f8db29. Configure here.
healthStatus returns null when Linq omits reputation/health_status; declare nullable: true to match the runtime value (same as forwardingNumber).
phoneNumbers/createdAt/updatedAt are null-coerced by mapWebhookSubscription; declare nullable: true on the array-item schema to match runtime (consistent with the top-level webhook outputs' optional flags).
|
@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 1f8c0ef. Configure here.
Summary
create_chat: read the sent message from the top-levelresponse.message(was nested underchat, so alwaysnull)get_message/edit_message: expose canonicaldeliveryStatus; markis_delivered/is_readdeprecatedsend_message: fall back tofrom_handle.service/preferred_servicefor theserviceoutputlist_phone_numbers: migrate deprecatedhealth_status→reputation, addforwardingNumber, guard JSON parsecheck_imessage/check_rcs: guardresponse.json()parsemark_chat_read: document 1:1-only / group no-op behavior{id}.{timestamp}.{body},whsec_secret)createSubscription/deleteSubscriptionregister and deregister the Linq webhook automatically on deploy/undeploy — no manual setupevent_id-based idempotency; full 27-valueWebhookEventTypeenum for the all-events triggerType of Change
Testing
Tested manually. Typecheck clean, biome clean,
check:api-validationpasses. Tools and trigger validated field-by-field against the live Linq OpenAPI spec; signature scheme and event enum verified verbatim.Checklist