fix(braze-42): honor replaceSkuWithProductName on recommended eCommerce path#733
Conversation
…ce path Recommended eCommerce forwarding (useEcommerceRecommendedEvents) always used product.sku as productId, while legacy logPurchase honors the replaceSkuWithProductName setting. The same commerce event could therefore identify products differently in Braze depending on which forwarding path ran. Add recommendedProductId(), mirroring the legacy flag check, and use it everywhere the recommended path emits a product identifier (line items, ProductViewedEvent, and the order_refunded JSON payload). Also removes a redundant explicit `it ->` lambda label in logEvent flagged during PR #728 review. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR SummaryLow Risk Overview This PR adds Reviewed by Cursor Bugbot for commit 8e1f40b. Bugbot is set up for automated code reviews on this repo. Configure here. |
|



Summary
Follow-up to #728 addressing Cursor Bugbot's "SKU replacement flag ignored" finding.
useEcommerceRecommendedEvents) always usedproduct.skuasproductId, while legacylogPurchasehonorsreplaceSkuWithProductName. The same commerce event could therefore identify products differently in Braze depending on which forwarding path ran.recommendedProductId(), mirroring the legacy flag check, and uses it everywhere the recommended path emits a product identifier: line items (recommendedLineItems),ProductViewedEvent, and theorder_refundedJSON payload (recommendedProductsJson).it ->lambda label inlogEventflagged in review.Stacked on #728 — this branch is based on
feat/braze-42-recommended-ecommerceand should be retargeted toworkstation/6.0-Releaseonce #728 merges.Test plan
RecommendedEcommerceTests— added coverage for the flag on the cart/line-item, product-detail, and refund paths (12/12 tests pass)ktlintCheckpasses on the kit