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

Service worker unable to cache if path is too long #1900

Closed
Mintyboi opened this issue Nov 1, 2021 · 4 comments
Closed

Service worker unable to cache if path is too long #1900

Mintyboi opened this issue Nov 1, 2021 · 4 comments
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@Mintyboi
Copy link

Mintyboi commented Nov 1, 2021

@champnic I found something new on #1757. I'm logging this as a separate issue as the previous question has already been answered.

I believe the DOMException: Entry already exists. error happens when the path to the Service Worker cache is too long.

I find that when I have 117 or more characters before the EBWebView folder, I'll get this error.
An example here is the path on my local computer: C:\TEMP\WebView2SWcacheissue\a7c66f9ab547a4e60dc59618116a46612b7b05d4a7c66f9ab547a4e0s\WebView2APISample.exe.WebView2
And here is what I presume to be the path to the SW cache: C:\TEMP\WebView2cacheissue\a7c66f9ab547a4e60dc59618116a46612b7b05d4a7c66f9ab547a4e0sac\WebView2APISample.exe.WebView2\EBWebView\Default\Service Worker\CacheStorage\a7c66f9ab547a4e60dc59618116a46612b7b05d4\b29766a4-bcaf-4941-bc18-502db781e5df

I've attached a sample project that can reproduce this issue when placed at the correct place.
Reproduce steps:

  1. Launch WebView2APISample.exe
  2. Right click and click on Inspect to launch the dev console
  3. Go to Scenario > Virtual Host Mapping with Service Worker
  4. Go back to the dev console and look at the console tab

WebView2SWcacheissue.zip

Is this an issue with WebView2? Or will you attribute it to chromium?

AB#40445348

@champnic champnic added bug Something isn't working and removed question labels Nov 2, 2021
@champnic
Copy link
Member

champnic commented Nov 2, 2021

@Mintyboi
Hey Benjamin,

This looks like it's caused by a MAX_PATH issue. It's likely shared with Edge browser and Chromium. Chromium has indicated they aren't going to fix MAX_PATH issues for now: https://bugs.chromium.org/p/chromium/issues/detail?id=1055336

Are you able to use a shorter user data folder?

@Mintyboi
Copy link
Author

Mintyboi commented Nov 3, 2021

Thanks for linking the chromium bug, Nic!
I guess I'll just have to do that (use a shorter user data folder).

@champnic
Copy link
Member

champnic commented Nov 5, 2021

No problem, and apologies for the limitation here!

@champnic champnic closed this as completed Nov 5, 2021
@LiangTheDev LiangTheDev added the tracked We are tracking this work internally. label Jul 13, 2022
@champnic
Copy link
Member

It looks like we did put in a fix here for runtime versions 105.0.1327.0+.

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

No branches or pull requests

3 participants