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

Custom Favicon always overwritten by B2B Favicon #1257

Closed
paramaeder opened this issue Aug 23, 2022 · 1 comment · Fixed by #1261
Closed

Custom Favicon always overwritten by B2B Favicon #1257

paramaeder opened this issue Aug 23, 2022 · 1 comment · Fixed by #1261
Assignees
Labels
bug Something isn't working

Comments

@paramaeder
Copy link
Contributor

paramaeder commented Aug 23, 2022

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:

server.get(/.*\/favicon.ico.*/, (req, _, next) => {

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 paramaeder added the bug Something isn't working label Aug 23, 2022
@dhhyi dhhyi self-assigned this Aug 27, 2022
@dhhyi
Copy link
Collaborator

dhhyi commented Aug 27, 2022

@paramaeder Thanks for reporting and analyzing. 👍
The regular expression in that line is too greedy and has to exclude requests to the assets folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants