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

Custom Favicon always overwritten by B2B Favicon

Open paramaeder opened this issue 2 years ago • 0 comments

Currently, the deployed PWA always sets the B2B favicon instead of the specific channel icon for example in multi channel projects (/assets/channelname/favicon.ico).

The favicon is correctly copied to the specific channel's directory when building the PWA. I checked this by building the PWA locally via docker compose and hooking into the Docker container to check the favicons.

In very rare cases respectively depending on the duration of the get request you can observe in the browser tab how the initially correct favicon is replaced by the B2B favicon.

The error seems to have come with #1199 - more specifically: https://github.com/intershop/intershop-pwa/blob/90c384ceac0efa7e376894a58ba9882da817e5cd/server.ts#L307 This request fetches the b2b favicon after the PWA has set the correct channel specific favicon and overwrites it.

Here a concrete log: foo-pwa-pwa-1 | 1 b2b GET /assets/themes/bar/img/favicon.ico 200 102134 - 1.243 ms foo-pwa-pwa-1 | 2 b2b GET /demo-b2c/favicon.ico;lang=de_DE;currency=;currency=EUR;icmHost=default;channel=Demo-Demo_de-Site;features=compare,recently,storeLocator,guestCheckout,wishlists,tracking,maps,contactUs;theme=b2b;baseHref=%252Fdemo-b2c;device=desktop 200 102134 - 1.265 ms foo-pwa-nginx-1 | 172.18.0.1 - - [16/Aug/2022:14:37:00 +0000] "GET /demo-b2c/favicon.ico HTTP/1.1" 200 5087 "http://localhost:4200/assets/themes/bar/img/favicon.ico" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"

This problem cannot be reconstructed with a locally started server but requires building the app via docker compose.

AB#79024

paramaeder avatar Aug 23 '22 17:08 paramaeder