Skip to content

Conversation

@anush
Copy link

@anush anush commented Nov 5, 2025

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

    • Added "New Purchase Created (Instant)", "Purchase Canceled (Instant)", and "Purchase Updated (Instant)" webhook sources with sample/test event payloads.
  • Chores

    • Deprecated "New Order Created (Instant)", "Order Deleted (Instant)", and "Order Updated (Instant)"; please migrate to the corresponding "Purchase ..." sources.
    • Deprecated sources received metadata version bumps.

@vercel
Copy link

vercel bot commented Nov 5, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
pipedream-docs-redirect-do-not-edit Ignored Ignored Nov 5, 2025 9:16pm

@adolfo-pd adolfo-pd added the User submitted Submitted by a user label Nov 5, 2025
@anush anush changed the title Deprecated order.* sources and introduced purchase.* sources to replace them [Xola] Deprecated order.* sources and introduced purchase.* sources to replace them Nov 5, 2025
@pipedream-component-development
Copy link
Collaborator

Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified.

@pipedream-component-development
Copy link
Collaborator

Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 5, 2025

Walkthrough

Three 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

Cohort / File(s) Summary
Deprecated Sources
components/xola/sources/new-order-created-instant/new-order-created-instant.mjs, components/xola/sources/order-deleted-instant/order-deleted-instant.mjs, components/xola/sources/order-updated-instant/order-updated-instant.mjs
Appended deprecation notice to description directing to corresponding "Purchase ..." replacements; bumped version from 0.0.10.0.2. No functional changes.
New: Purchase Canceled Source
components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs, components/xola/sources/purchase-canceled-instant/test-event.mjs
Added xola-purchase-canceled-instant source (type: source, version: 0.0.1) with getEventName()"purchase.cancel" and generateMeta(body) producing { summary, ts }. Includes comprehensive purchase.cancel test payload.
New: Purchase Created Source
components/xola/sources/purchase-created-instant/purchase-created-instant.mjs, components/xola/sources/purchase-created-instant/test-event.mjs
Added xola-new-purchase-created-instant source (type: source, version: 0.0.1) with getEventName()"purchase.create" and generateMeta(body). Includes comprehensive purchase.create test payload.
New: Purchase Updated Source
components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs, components/xola/sources/purchase-updated-instant/test-event.mjs
Added xola-purchase-updated-instant source (type: source, version: 0.0.1) with getEventName()"purchase.update" and generateMeta(body). Includes comprehensive purchase.update test payload.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review focus:
    • Consistency of getEventName() and generateMeta() across new sources.
    • Accuracy and completeness of the large nested test-event payloads (field names, IDs, monetary amounts, audit deltas).
    • Correctness of deprecation messages and that referenced replacement source names match the new source names/keys.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main changes: deprecating old order sources and introducing purchase sources as replacements, which aligns with the changeset.
Description check ✅ Passed The description addresses the core reason for the changes but is minimal, covering only the WHY section required by the template.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 1ccd2b4 and a4cf642.

📒 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.mjs
  • components/xola/sources/purchase-created-instant/purchase-created-instant.mjs
  • components/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.mjs
  • components/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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: use data.updatedAt from the webhook payload to ensure stable IDs across retries.

components/xola/sources/purchase-canceled-instant/purchase-canceled-instant.mjs (1)

10-11: Missing dedupe property.

The dedupe: "unique" property should be defined between type: "source" and methods: 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

📥 Commits

Reviewing files that changed from the base of the PR and between a4cf642 and b078d0e.

📒 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.mjs
  • components/xola/sources/purchase-updated-instant/purchase-updated-instant.mjs
  • components/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.mjs
  • components/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-name pattern, the naming is clear, and the version is appropriate for a new component. This aligns with the PR objective of replacing deprecated order.* webhooks with purchase.* 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 sampleEmit follows 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() and generateMeta() 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 sampleEmit export 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 sampleEmit reference follows the standard pattern for providing test event payloads in Pipedream sources.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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: Add id field and use payload timestamp.

The generateMeta method has several issues:

  1. Missing id field: Required for deduplication to work properly
  2. Timestamp accuracy: Using Date.now() captures processing time, not event creation time
  3. Error handling: No validation for body.data or data.id

Apply 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

📥 Commits

Reviewing files that changed from the base of the PR and between b078d0e and e6ed2e9.

📒 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.mjs
  • components/xola/sources/purchase-created-instant/purchase-created-instant.mjs
  • components/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.mjs
  • components/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.mjs
  • components/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)

Copy link
Collaborator

@jcortes jcortes left a 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

@jcortes jcortes moved this from Ready for PR Review to Changes Required in Component (Source and Action) Backlog Nov 5, 2025
@jcortes
Copy link
Collaborator

jcortes commented Nov 12, 2025

Hi @anush just wondering if you are still working on this PR? if not let me know so I can reassign it!

@anush
Copy link
Author

anush commented Nov 13, 2025

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

@jcortes
Copy link
Collaborator

jcortes commented Nov 13, 2025

Hi @anush thanks for letting me know, I will take care of it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

User submitted Submitted by a user

Development

Successfully merging this pull request may close these issues.

4 participants