-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Xola] Deprecated order.* sources and introduced purchase.* sources to replace them
#18963
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
order.* sources and introduced purchase.* sources to replace themorder.* sources and introduced purchase.* sources to replace them
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
WalkthroughThree legacy Xola "Order" webhook sources were marked deprecated (description updated and version bumped). Three new Xola "Purchase" instant webhook sources were added (create, update, cancel), each with a sample test-event payload and minimal methods for event naming and meta generation. Changes
Sequence Diagram(s)sequenceDiagram
participant X as Xola Webhook
participant S as Source Module
participant E as Event Emitter
rect rgb(245,250,255)
note over X,S: Incoming webhook POST (purchase.create/update/cancel)
X->>S: POST payload
S->>S: getEventName(payload)
S->>S: generateMeta(payload)
S->>E: emit(eventName, { data: payload.data, meta })
E-->>S: ack
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Pre-merge checks and finishing touches✅ Passed checks (2 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: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (9)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs(1 hunks)components/xola/sources/order-deleted-instant/order-deleted-instant.mjs(1 hunks)components/xola/sources/order-updated-instant/order-updated-instant.mjs(1 hunks)components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs(1 hunks)components/xola/sources/purchase-canceled-instant/test-event.mjs(1 hunks)components/xola/sources/purchase-created-instant/purchase-created-instant.mjs(1 hunks)components/xola/sources/purchase-created-instant/test-event.mjs(1 hunks)components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs(1 hunks)components/xola/sources/purchase-updated-instant/test-event.mjs(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 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/xola/sources/purchase-updated-instant/purchase-updated-instant.mjscomponents/xola/sources/purchase-created-instant/purchase-created-instant.mjscomponents/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjscomponents/xola/sources/purchase-created-instant/purchase-created-instant.mjs
🧬 Code graph analysis (2)
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (5)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
body(18-18)components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (2)
body(18-18)ts(19-19)components/xola/sources/order-updated-instant/order-updated-instant.mjs (2)
body(18-18)ts(19-19)components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (2)
body(18-18)ts(19-19)components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (1)
body(18-18)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (5)
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
body(18-18)components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (2)
body(18-18)ts(19-19)components/xola/sources/order-updated-instant/order-updated-instant.mjs (2)
body(18-18)ts(19-19)components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (1)
body(18-18)components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (2)
body(18-18)ts(19-19)
🔇 Additional comments (8)
components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)
8-9: LGTM! Deprecation notice clearly communicates migration path.The deprecation notice properly directs users to the replacement source and the version bump follows semantic versioning for metadata changes.
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
8-9: LGTM! Deprecation notice properly guides users to the replacement.The metadata changes correctly communicate the deprecation and migration path.
components/xola/sources/purchase-canceled-instant/test-event.mjs (1)
1-543: LGTM! Test event payload is comprehensive and correctly structured.The test payload appropriately reflects a canceled purchase with the correct event name "purchase.cancel" and includes an audit trail showing the status transition from "confirmed" to "canceled".
components/xola/sources/purchase-created-instant/test-event.mjs (1)
1-534: LGTM! Test event payload correctly represents a purchase creation.The test payload appropriately uses event name "purchase.create" with an empty audit object (since there's no prior state for a creation event).
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (1)
1-28: LGTM! New purchase created source is correctly implemented.The implementation properly replaces the deprecated "New Order Created" source with the correct event name "purchase.create" and follows the established pattern.
components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1)
8-9: LGTM! Deprecation notice correctly maps deletion to cancellation.The deprecation appropriately directs users from "Order Deleted" to "Purchase Canceled" and the version bump is consistent with other deprecated sources.
components/xola/sources/purchase-updated-instant/test-event.mjs (1)
1-543: LGTM! Test event payload correctly represents a purchase update.The test payload appropriately uses event name "purchase.update" and includes an audit trail showing the arrivalDate field change, which is representative of an update event.
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (1)
1-11: LGTM! Structure follows established conventions.The imports, base configuration, and properties are correctly structured and consistent with other Xola webhook sources. The key, name, and description clearly identify this as the purchase update webhook source, and the dedupe setting is appropriate for webhook events.
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs
Show resolved
Hide resolved
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs
Show resolved
Hide resolved
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: 2
♻️ Duplicate comments (2)
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (1)
16-24: Deduplication issue with timestamp-based ID (already flagged).The use of
Date.now()for generating event IDs causes duplicate event emissions on webhook retries, as previously noted. The past review comment provides the correct solution: usedata.updatedAtfrom the webhook payload to ensure stable IDs across retries.components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (1)
10-11: Missingdedupeproperty.The
dedupe: "unique"property should be defined betweentype: "source"andmethods:to follow Pipedream best practices for webhook sources.Apply this diff:
type: "source", + dedupe: "unique", methods: {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs(1 hunks)components/xola/sources/purchase-created-instant/purchase-created-instant.mjs(1 hunks)components/xola/sources/purchase-updated-instant/purchase-updated-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/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjscomponents/xola/sources/purchase-updated-instant/purchase-updated-instant.mjscomponents/xola/sources/purchase-created-instant/purchase-created-instant.mjs
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjscomponents/xola/sources/purchase-created-instant/purchase-created-instant.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/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs
🧬 Code graph analysis (2)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (5)
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (1)
body(17-17)components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (2)
body(17-17)ts(18-18)components/xola/sources/order-updated-instant/order-updated-instant.mjs (2)
body(18-18)ts(19-19)components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
body(18-18)components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (2)
body(18-18)ts(19-19)
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (5)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (2)
body(17-17)ts(18-18)components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (1)
body(17-17)components/xola/sources/order-updated-instant/order-updated-instant.mjs (2)
body(18-18)ts(19-19)components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
body(18-18)components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (2)
body(18-18)ts(19-19)
🔇 Additional comments (9)
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (4)
1-3: LGTM - Standard import structure.The imports correctly reference the common webhook configuration and test event sample, following the established pattern for Pipedream components.
4-10: LGTM - Component metadata follows Pipedream guidelines.The component key follows the
app_name_slug-slugified-component-namepattern, the naming is clear, and the version is appropriate for a new component. This aligns with the PR objective of replacing deprecatedorder.*webhooks withpurchase.*webhooks.
13-15: LGTM - Correct webhook event name.The
getEventName()method returns"purchase.update", which correctly aligns with the new purchase-based webhook events that are replacing the deprecated order events.
26-26: LGTM - Test event sample included.Including
sampleEmitfollows Pipedream best practices for providing example webhook payloads, which aids in testing and documentation.components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (3)
1-2: LGTM: Imports are correct.The imports follow standard patterns for Pipedream webhook sources.
11-25: LGTM: Methods implementation follows established patterns.The
getEventName()andgenerateMeta()methods are correctly implemented and consistent with other purchase webhook sources in this codebase. The ID generation strategy (appending timestamp) ensures each webhook call is treated as a unique event, which is appropriate for instant webhook sources.
26-26: LGTM: Sample emit is properly exported.The
sampleEmitexport provides test event data as required for Pipedream sources.components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (2)
1-2: LGTM!The imports follow the standard pattern for extending webhook sources in Pipedream.
25-26: LGTM!The
sampleEmitreference follows the standard pattern for providing test event payloads in Pipedream sources.
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs
Show resolved
Hide resolved
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs
Show resolved
Hide resolved
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: 2
♻️ Duplicate comments (2)
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (2)
4-10: Add deduplication strategy.The component should include
dedupe: "unique"to prevent duplicate events from being emitted. Even though Xola webhooks may not retry, deduplication protects against system restarts, race conditions, or manual re-deployments.Apply this diff:
key: "xola-new-purchase-created-instant", name: "New Purchase Created (Instant)", description: "Emit new event when a new purchase is created.", version: "0.0.1", type: "source", + dedupe: "unique", methods: {As per coding guidelines.
16-22: Addidfield and use payload timestamp.The
generateMetamethod has several issues:
- Missing
idfield: Required for deduplication to work properly- Timestamp accuracy: Using
Date.now()captures processing time, not event creation time- Error handling: No validation for
body.dataordata.idApply this diff:
generateMeta(body) { const { data } = body; + if (!data?.id) { + throw new Error("Invalid webhook payload: missing data.id"); + } return { + id: data.id, summary: `New Purchase ${data.id}`, - ts: Date.now(), + ts: data.createdAt ? Date.parse(data.createdAt) : Date.now(), }; },Based on learnings about timestamp handling in webhook sources.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs(1 hunks)components/xola/sources/purchase-created-instant/purchase-created-instant.mjs(1 hunks)components/xola/sources/purchase-updated-instant/purchase-updated-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/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjscomponents/xola/sources/purchase-created-instant/purchase-created-instant.mjscomponents/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs
📚 Learning: 2024-10-10T19:18:27.998Z
Learnt from: GTFalcao
Repo: PipedreamHQ/pipedream PR: 14265
File: components/the_magic_drip/sources/common.mjs:35-43
Timestamp: 2024-10-10T19:18:27.998Z
Learning: In `components/the_magic_drip/sources/common.mjs`, when processing items in `getAndProcessData`, `savedIds` is intentionally updated with IDs of both emitted and non-emitted items to avoid emitting retroactive events upon first deployment and ensure only new events are emitted as they occur.
Applied to files:
components/xola/sources/purchase-created-instant/purchase-created-instant.mjscomponents/xola/sources/purchase-updated-instant/purchase-updated-instant.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/xola/sources/purchase-created-instant/purchase-created-instant.mjscomponents/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs
🧬 Code graph analysis (3)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (5)
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (1)
body(17-17)components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (1)
body(17-17)components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
body(18-18)components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)
body(18-18)components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1)
body(18-18)
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (5)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (1)
body(17-17)components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (1)
body(17-17)components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
body(18-18)components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)
body(18-18)components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1)
body(18-18)
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs (5)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (1)
body(17-17)components/xola/sources/purchase-created-instant/purchase-created-instant.mjs (1)
body(17-17)components/xola/sources/new-order-created-instant/new-order-created-instant.mjs (1)
body(18-18)components/xola/sources/order-updated-instant/order-updated-instant.mjs (1)
body(18-18)components/xola/sources/order-deleted-instant/order-deleted-instant.mjs (1)
body(18-18)
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs
Show resolved
Hide resolved
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs
Show resolved
Hide resolved
jcortes
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.
Hi @anush thanks for this great contribution. Just make sure you increase the version in package.json to 0.2.0 and fix the minor changes I pointed out in the comments other than that it is looking great. Thanks
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs
Show resolved
Hide resolved
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs
Show resolved
Hide resolved
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs
Show resolved
Hide resolved
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs
Show resolved
Hide resolved
|
Hi @anush just wondering if you are still working on this PR? if not let me know so I can reassign it! |
|
@jcortes Thanks for following up. I might not be able to get back to this until late next week. You're welcome to hand it to someone else if you have the bandwidth. |
|
Hi @anush thanks for letting me know, I will take care of it. Thanks! |
WHY
The
order.*Xola webhooks are deprecated will be discontinued in 2026.The
purchase.*webhooks are their successor and offer much richer data including support for audits.Summary by CodeRabbit
New Features
Chores