Skip to content
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

@W-15162424: Fix customer product lists error #1689

Merged
merged 5 commits into from
Mar 12, 2024

Conversation

alexvuong
Copy link
Collaborator

Description

Fix issue describe in #1685.
Root cause, in current implementation, for wishlist, we will call getCustomerProductList to retrive the wishlist, and will sequentially call createProductList to create a new list if none is existing and will update product list cache with data from createProductList mutation.

The error happens because the cache presumes data array is always present from getCustomerProductList accordding to doc. In reality, data will be undefined if the user has no list existing.

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

  • check out code
  • npm ci at root
  • npm start to start up retail app
  • delete all localstorage and cookie
  • Navigate to PLP page.
  • You should not see any error and confirm that the cache is updated properly after createProductList mutation is successful

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@alexvuong alexvuong requested a review from a team as a code owner March 7, 2024 01:25
bendvc
bendvc previously approved these changes Mar 12, 2024
vcua-mobify
vcua-mobify previously approved these changes Mar 12, 2024
Copy link
Collaborator

@kevinxh kevinxh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a unit test to prevent regression please 🙏🙏🙏

@alexvuong alexvuong dismissed stale reviews from vcua-mobify and bendvc via a3167b6 March 12, 2024 21:53
@alexvuong alexvuong merged commit ad05c6e into develop Mar 12, 2024
28 checks passed
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.

None yet

5 participants