intershop-pwa icon indicating copy to clipboard operation
intershop-pwa copied to clipboard

fix: do not overide product information in the state with information with lower completeness level

Open shauke opened this issue 2 years ago • 0 comments

PR Type

[x] Bugfix

What Is the Current Behavior?

Product images and description are sometimes missing on the product detail page when routing there from a product list.

This happens if the category products call responds later then the product details call. Both calls are triggered when routing to the product details page.

Problem 1: There is no need for the additional category products call when routing to the product details page.

Problem 2: Product information with a lower completeness level should not overwrite product information in the state with a higher completeness level.

What Is the New Behavior?

The first commit addresses Problem 1 by reverting the commit that introduced this wrong behavior.

The second commit fixes the product information state update handling and considers the different completeness levels.

  • update the complete product information in the state if the new product information has a higher or equal completeness level than the current product information in the state
  • always update the availability information in the state with the new product information

Does this PR Introduce a Breaking Change?

[x] No

Other Information

The fix for the issue of #1140 is reverted since it introduced more problems then it fixed. A new fix for #1140 will be necessary.

AB#79022

shauke avatar Aug 23 '22 16:08 shauke