@W-19718906 bug: duplicate bonus products when store pickup for same product#3348
Merged
sf-shikhar-prasoon merged 5 commits into3.13.0-preview.5from Sep 24, 2025
Conversation
Collaborator
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
shethj
approved these changes
Sep 23, 2025
Contributor
There was a problem hiding this comment.
I see another issue with the code.
See https://salesforce-internal.slack.com/archives/C08RM5UV613/p1758667949037929?thread_ts=1758657795.219949&cid=C08RM5UV613
sf-xingquan-jin
approved these changes
Sep 23, 2025
shethj
reviewed
Sep 23, 2025
Contributor
shethj
left a comment
There was a problem hiding this comment.
We have another non-edge case bug.
shethj
approved these changes
Sep 23, 2025
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is to fix a bug where Bonus products showing up twice if the same product is added as store pickup
The bug was discovered by Jainam first (slack thread)
Please refer to the slack thread or work item for a video demo of the bug.
Types of Changes
Changes
Our Solution: Capacity-Based Sequential Allocation
We implemented a sophisticated distribution system that:
Key Features Implemented
New Distribution Function: getBonusProductsForSpecificCartItem()
Updated Cart Display: Modified CartProductListWithGroupedBonusProducts
Comprehensive Testing: Added 6 new test scenarios covering:
Expected Results
The implementation preserves all existing functionality while correctly distributing bonus products across cart items to eliminate the duplication
bug. Global capacity calculations remain accurate for button text display.
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization