Skip to content

breaking: remove deprecated logCheckout, logPurchase, and logRefund methods#1238

Open
rmi22186 wants to merge 2 commits intoworkstation/3.0-Releasefrom
breaking/remove-deprecated-logcommerce-methods
Open

breaking: remove deprecated logCheckout, logPurchase, and logRefund methods#1238
rmi22186 wants to merge 2 commits intoworkstation/3.0-Releasefrom
breaking/remove-deprecated-logcommerce-methods

Conversation

@rmi22186
Copy link
Copy Markdown
Member

@rmi22186 rmi22186 commented Apr 3, 2026

Summary

  • Removes deprecated mParticle.eCommerce.logCheckout(), mParticle.eCommerce.logPurchase(), and mParticle.eCommerce.logRefund() methods
  • Removes corresponding internal implementations (logCheckoutEvent, logPurchaseEvent, logRefundEvent) from events layer
  • Removes interface definitions, stub entries, snippet queue support, and the BadLogPurchase error constant
  • Updates tests: removes 15 eCommerce tests and 2 native SDK tests that used deprecated methods, adds back 9 equivalent eCommerce tests and 2 native SDK tests using logProductAction

Migration

Users should migrate to mParticle.eCommerce.logProductAction() with the appropriate ProductActionType:

Deprecated Method Replacement
logCheckout(step, option, attrs, customFlags) logProductAction(ProductActionType.Checkout, product, attrs, customFlags, transactionAttributes)
logPurchase(transactionAttributes, product, clearCart, attrs, customFlags) logProductAction(ProductActionType.Purchase, product, attrs, customFlags, transactionAttributes)
logRefund(transactionAttributes, product, clearCart, attrs, customFlags) logProductAction(ProductActionType.Refund, product, attrs, customFlags, transactionAttributes)

Test plan

  • Build passes (npm run build)
  • All 1025 tests pass (npm test — Chrome Headless)
  • No remaining references to removed methods in source or test files
  • Verify no downstream SDK consumers depend on these methods

…ethods

These deprecated eCommerce methods have been removed in favor of
logProductAction which provides the same functionality with a more
flexible API. Users should migrate to logProductAction with the
appropriate ProductActionType (Checkout, Purchase, Refund).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rmi22186 rmi22186 force-pushed the breaking/remove-deprecated-logcommerce-methods branch 11 times, most recently from d7a8d6c to ae3a9b4 Compare April 3, 2026 18:03
@rmi22186 rmi22186 force-pushed the breaking/remove-deprecated-logcommerce-methods branch from ae3a9b4 to b4f0815 Compare April 3, 2026 18:08
…ted methods

Adds tests that replace removed logCheckout/logPurchase/logRefund tests
with equivalent coverage using logProductAction:
- Full DTO validation for purchase and refund events
- Badly formed ecommerce input sanitization
- Array of products support for purchase and refund
- Product position null handling
- Expand commerce events with/without summary total (plus-one)
- CustomFlags for checkout, purchase, and refund actions
- Native SDK bridge product list serialization (Android + iOS)
- Clarified expand test names with plus-one context comments

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rmi22186 rmi22186 force-pushed the breaking/remove-deprecated-logcommerce-methods branch from b4f0815 to af285fa Compare April 3, 2026 18:10
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 3, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
45.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@rmi22186 rmi22186 marked this pull request as ready for review April 3, 2026 18:13
@rmi22186 rmi22186 requested a review from a team as a code owner April 3, 2026 18:13
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 3, 2026

PR Summary

Medium Risk
This is a breaking public API removal for eCommerce logging, requiring downstream consumers to migrate to logProductAction and potentially impacting integrations that still call the deprecated methods.

Overview
Removes the deprecated eCommerce entry points logCheckout, logPurchase, and logRefund across the SDK surface area (public interfaces, instance manager proxy, snippet pre-init queue support, stubs, and error messaging).

Drops the corresponding internal event helpers (logCheckoutEvent, logPurchaseEvent, logRefundEvent) so checkout/purchase/refund tracking is now only performed via eCommerce.logProductAction with the appropriate ProductActionType.

Updates and reshapes tests to stop asserting deprecated-method behavior and instead validate equivalent purchase/refund/checkout behavior through logProductAction, including array product support, custom flags, and commerce event expansion expectations.

Written by Cursor Bugbot for commit af285fa. This will update automatically on new commits. Configure here.

@rmi22186 rmi22186 changed the base branch from master to workstation/3.0-Release April 3, 2026 18:13
@rmi22186 rmi22186 requested a review from alexs-mparticle April 3, 2026 19:14
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