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

LocalStorage not persisted to disk with relative CachePath #3074

Closed
D4koon opened this issue Mar 2, 2020 · 9 comments
Closed

LocalStorage not persisted to disk with relative CachePath #3074

D4koon opened this issue Mar 2, 2020 · 9 comments
Labels
upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.

Comments

@D4koon
Copy link

D4koon commented Mar 2, 2020

  • What version of the product are you using?
    79.1.360 - nuget

  • What architecture x86 or x64?
    x86

  • On what operating system?
    Win10

  • Are you using WinForms, WPF or OffScreen?
    WPF

  • What steps will reproduce the problem?
    When im using relative path for CachePath like the code given on the wiki:
    https://github.com/cefsharp/CefSharp/wiki/General-Usage#initialize-and-shutdown
    settings.CachePath = "cache";
    The local-cache does not persist after restart also i have proper read/right rights on the folder.
    Its also writing something...
    I also tried other relative paths like "../cache" or "cachetest" which also not work

  • What is the expected output? What do you see instead?
    After restart the data from local storage is still available

  • How to fix
    Using the full path works without problem:
    "settings.CachePath = C:\\XXX\\bin\\x86\\Debug\\cache";

@amaitland amaitland added the upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. label Mar 2, 2020
@amaitland
Copy link
Member

amaitland commented Mar 2, 2020

Please test with the CEF Sample application as detailed in the Bug Report Template

You can specify a cache path using the command line args cache-path

https://github.com/chromiumembedded/cef/blob/019611c7649ec982b86a0d8c6969e6dfbd37f2e9/tests/shared/common/client_switches.cc#L22

@amaitland
Copy link
Member

amaitland commented Mar 4, 2020

Was any attempt made to reproduce the problem with the MinimalExample?

Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory)

Did you check the log file?

@D4koon
Copy link
Author

D4koon commented Mar 4, 2020 via email

@D4koon
Copy link
Author

D4koon commented Mar 8, 2020

I now tested it witht the minimal-example and it is still the same bug as reported

I changed the line in App.xaml.cs:
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache")
to:
CachePath = "cache"

@amaitland
Copy link
Member

I now tested it witht the minimal-example and it is still the same bug as reported

Is the cache folder created? Does it have sub folders? Personally I cannot reproduce this problem, it works as expected for me. A Cache folder is created with the expected files and subfolders.

Does the cef log provide any relevant information? (By default there should be a debug.log file in your bin directory)

Did you check the Log File?

Please test with the CEF Sample application as detailed in the Bug Report Template

You can specify a cache path using the command line args cache-path

https://github.com/chromiumembedded/cef/blob/019611c7649ec982b86a0d8c6969e6dfbd37f2e9/tests/shared/common/client_switches.cc#L22

Please test with the CEF Sample Application as requested, use the --cache-path=cache command line arg.

CefSharp does little more than pass the value to CefSettings.cache_path.

@D4koon
Copy link
Author

D4koon commented Mar 9, 2020

Is the cache folder created? Does it have sub folders? Personally I cannot reproduce this problem, it works as expected for me. A Cache folder is created with the expected files and subfolders.

yes the folder is created:
image

Did you check the Log File?

yes i checked debug.log but it contains only errors which happen in both the relative and non-relativ cachePath tests:

[0309/155410.273:ERROR:broker_win.cc(55)] Error reading broker pipe: Error (0x5) while retrieving error. (0x6D)
[0309/155410.273:ERROR:command_buffer_proxy_impl.cc(93)] ContextResult::kFatalFailure: AllocateAndMapSharedMemory failed

Please test with the CEF Sample Application as requested, use the --cache-path=cache command line arg.
I tried it and it has the same problem. Relativ path does not work.

One note i have to make here is that i only tested it with https://web.whatsapp.com
And there it would not save the login-data in local-cache.

@amaitland
Copy link
Member

I tried it and it has the same problem. Relativ path does not work.

Thanks for confirming 👍 You'll need to create an issue on the CEF Issue Tracker as the problem will need to be fixed in CEF. Please post a link back here for reference.

One note i have to make here is that i only tested it with https://web.whatsapp.com
And there it would not save the login-data in local-cache.

I personally don't use whatsapp, I've tested with https://magpcss.org/ceforum/index.php and a relative path and it works as expected. So best to include this when you open the issue.

I've updated the General Usage Guide to use a absolute path see https://github.com/cefsharp/CefSharp/wiki/General-Usage/_compare/111a3633c3e58c9502f26e4386b8100b7ce4d025...69741e80118da403d7c086695965427869164f1e

As it stands I've not seen any similar reports, if there are enough cases to implement a workaround then we can look at calling Path.GetFullPath before setting the _cef_settings_t::cache_path value.

Closing now as this needs to be fixed in CEF. Obvious workaround is to use an absolute path.

@amaitland amaitland changed the title settings.CachePath not working with relative path LocalStorage not persisted to disk with relative CachePath Apr 9, 2020
@amaitland
Copy link
Member

As it stands I've not seen any similar reports, if there are enough cases to implement a workaround then we can look at calling Path.GetFullPath before setting the _cef_settings_t::cache_path value.

Apparently CEF requires an absolute path, issue #3102 will track using Path.GetFullPath to ensure paths are absolute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.
Projects
None yet
Development

No branches or pull requests

2 participants