intershop / intershop-pwa

The Intershop PWA is an Angular based progressive web app storefront for the Intershop Commerce Platform.
https://www.intershop.com/progressive-web-app
MIT License
157 stars 82 forks source link

Performance issues with many shipping addresses #1528

Open ghost opened 10 months ago

ghost commented 10 months ago

Actual Behavior

Scenario: A customer has many shipping addresses (> 100). This could be a distributor who is ordering on behalf of his clients. So the invoice is paid by the distributor but the order is delivered to his client.

With this many addresses the performance is bad since each address is retrieved separately from the REST API. So you may have > 100 requests. Additionally the address list in My Account does not support paging.

Expected Behavior

Performance should be acceptable with many customer addresses.

Optional: Possibility to filter and select addresses. But this is more of a feature request.

Steps to Reproduce the Bug

  1. Import customer with many addresses and a user from the backoffice
  2. Go to My Account - Addresses
  3. It takes a long time to load all the addresses
  4. Add product to cart
  5. Go to Checkout - Addresses
  6. It takes a long time to load all the addresses

Tested with PWA 3.3. But I can see that separate requests are still executed in PWA 4.2 https://intershoppwa-b2b.azurewebsites.net/account/addresses

AB#90866

SGrueber commented 9 months ago

The current pwa is designed to handle 10-15 shipping addresses per customer. We will treat a scenario with more than 100 shipping addresses as described by you as a feature request, that requires the following changes

  1. MyAccount Shipping Address Page Improvements

    • introduce a paging or endless scrolling for the address list
    • add an address search Unfortunately, the REST response for customer/addresses returns only a link list, so a smarter address loading has to be implemented in the client as well as the address search
  2. Checkout Address Page Improvements

    • IAD changes (a selectbox is not sufficient to show a lot of addresses)
    • change the address loading, use the baskets/eligible-addresses REST call to fetch the available addresses for registered as well as unregistered customers, this REST call returns all the addresses (not only the links) and is more performant

We will refactor the address loading on checkout shipping page as soon as possible, all other changes we won't handle with a high priority.