-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[FIX] Inconsistent event format between deploy-time and real-time events #18980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[FIX] Inconsistent event format between deploy-time and real-time events #18980
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughThis pull request fixes an event format inconsistency in the Salesforce REST API component's "New Record" trigger. The deploy() hook now emits historical events in the same format as real-time webhook events by removing the "New" wrapper and "UserId" field. Component and source versions are incremented accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant Deploy as Deploy Hook
participant ProcessEvent as Process Webhook
participant Metadata as Generate Metadata
participant User as Downstream Consumer
rect rgb(240, 248, 255)
Note over Deploy,User: Historical Behavior (Before Fix)
Deploy->>ProcessEvent: event.body = { New: object, UserId: id }
ProcessEvent->>Metadata: data.body.New
Metadata->>Metadata: destructure { New: newObject }
Metadata->>User: metadata (works)
end
rect rgb(200, 230, 201)
Note over Deploy,User: Real-time Behavior (Always)
Deploy->>ProcessEvent: Webhook: event.body = object (direct)
ProcessEvent->>Metadata: data.body (no New wrapper)
Metadata->>Metadata: X fails - expects New property
Metadata->>User: metadata (broken)
end
rect rgb(200, 230, 201)
Note over Deploy,User: Unified Behavior (After Fix)
Deploy->>ProcessEvent: event.body = object (direct)
ProcessEvent->>Metadata: data.body (no New wrapper)
Metadata->>Metadata: read fields directly from data.body
Metadata->>User: metadata (works consistently)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (6)
components/salesforce_rest_api/package.json(1 hunks)components/salesforce_rest_api/sources/common/common-new-record.mjs(2 hunks)components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs(1 hunks)components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs(1 hunks)components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs(1 hunks)components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-07-24T02:06:47.016Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 12697
File: components/salesforce_rest_api/sources/common-webhook-methods.mjs:1-71
Timestamp: 2024-07-24T02:06:47.016Z
Learning: The `common-webhook-methods.mjs` object is designed to be extended, similar to an abstract class, and intentionally does not implement certain methods like `generateWebhookMeta` and `getEventType` to enforce implementation in subclasses.
Applied to files:
components/salesforce_rest_api/sources/common/common-new-record.mjs
📚 Learning: 2025-10-20T01:01:02.970Z
Learnt from: js07
Repo: PipedreamHQ/pipedream PR: 18744
File: components/slack_v2/actions/send-large-message/send-large-message.mjs:49-64
Timestamp: 2025-10-20T01:01:02.970Z
Learning: In components/slack_v2/actions/send-large-message/send-large-message.mjs, the metadata_event_payload prop is typed as string, so the code only needs to handle string-to-JSON parsing and does not need to handle object inputs.
Applied to files:
components/salesforce_rest_api/sources/common/common-new-record.mjs
📚 Learning: 2025-07-09T18:07:12.426Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 17538
File: components/aircall/sources/new-sms/new-sms.mjs:19-25
Timestamp: 2025-07-09T18:07:12.426Z
Learning: In Aircall API webhook payloads, the `created_at` field is returned as an ISO 8601 string format (e.g., "2020-02-18T20:52:22.000Z"), not as milliseconds since epoch. For Pipedream components, this needs to be converted to milliseconds using `Date.parse()` before assigning to the `ts` field in `generateMeta()`.
Applied to files:
components/salesforce_rest_api/sources/common/common-new-record.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Publish TypeScript components
- GitHub Check: pnpm publish
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
🔇 Additional comments (6)
components/salesforce_rest_api/package.json (1)
3-3: LGTM: Appropriate version bump for bug fix.The patch version increment from 1.10.0 to 1.10.1 correctly follows semantic versioning conventions for a bug fix release.
components/salesforce_rest_api/sources/new-email-template-instant/new-email-template-instant.mjs (1)
10-10: LGTM: Version bump reflects inherited fix.The version increment is appropriate since this component inherits the event format fix from common-new-record.mjs.
components/salesforce_rest_api/sources/new-knowledge-article-instant/new-knowledge-article-instant.mjs (1)
10-10: LGTM: Version bump reflects inherited fix.The version increment is appropriate since this component inherits the event format fix from common-new-record.mjs.
components/salesforce_rest_api/sources/new-record-instant/new-record-instant.mjs (1)
9-9: LGTM: Version bump reflects inherited fix.The version increment is appropriate since this component inherits the event format fix from common-new-record.mjs.
components/salesforce_rest_api/sources/new-case-instant/new-case-instant.mjs (1)
10-10: LGTM: Version bump reflects inherited fix.The version increment is appropriate since this component inherits the event format fix from common-new-record.mjs.
components/salesforce_rest_api/sources/common/common-new-record.mjs (1)
77-83: LGTM: Correctly updated to read directly from data.body.The method now correctly extracts
CreatedDate,Id, and the name field directly fromdata.bodyinstead of fromdata.body.New, matching the new consistent event format.
michelle0927
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
For Integration QA: |
WHY
Resolves #18929
Summary by CodeRabbit