MicrosoftEdge / MicrosoftEdge/WebView2Feedback

ClearBrowsingDataAsync regression on runtime version 112.0.1722.48

Open
#3,417 25 comments 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

bug regression tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
Hi,

We use a CoreWebView2Controller instance to interact with the WebView2 environment and CoreWebView2Controller.CoreWebView2.Profile.ClearBrowsingDataAsync(CoreWebView2BrowsingDataKinds.AllProfile) to clear data from the environment on demand. This worked fine in WebView2 runtime version 110.0.1587.46 but in runtime version 112.0.1722.48 the call to ClearBrowsingDataAsync hangs for ~60 seconds.

I investigated the issue and the hang occurs when calling CoreWebView2Controller.CoreWebView2.Profile.ClearBrowsingDataAsync(CoreWebView2BrowsingDataKinds.AllProfile) when there are no other WebView2 instances initialized in the process. I have reproduce this behavior using the WebView2WpfBrowser sample from Microsoft.

I've bundled the modified sample and both the 110.0.1587.46 and 112.0.1722.48 runtimes into this zip file (as it was too big for Github). Once extracted, you can recreate the issue by following the repro steps below.

Version
SDK: 1.0.1722.45
Runtime: 112.0.1722.48
Framework: WPF
OS: Windows 10 & 11

Repro Steps

  1. Load the ClearBrowsingDataRegression solution into Visual Studio
  2. Ensure the BYOWebView2CreationProperties resource in App.xaml is set to use the 112.0.1722.48 version of the runtime (e.g. BrowserExecutableFolder="..\..\..\..\WebView2Bundles\112.0.1722.48\WebView2").
  3. Start the app
  4. Navigate to a webpage by typing a URL into the address bar and hitting return (e.g. https://duckduckgo.com).
  5. Close the app (note: the app doesn't exit correctly so you need to stop it in Visual Studio)
  6. Restart the app
  7. Without navigating to a webpage (i.e. without initializing the WebView2 instance) use "Scenario->Clear Browsing Data->All Profile" to (attempt to) clear browsing data.
    -> This will hang in the "Controller.ClearUserData" method (line 30 - await Instance.CoreWebView2.Profile.ClearBrowsingDataAsync(dataKinds)) for around 60s.

This can be shown to be a regression by changing the BYOWebView2CreationProperties resource in App.xaml (Step 2 above) to use the 110.0.1587.46 version of the runtime (e.g. BrowserExecutableFolder="..\..\..\..\WebView2Bundles\110.0.1587.46\WebView2") and repeating the steps above whereupon step 8 will not hang.

Further information:

  • The hang only occurs when including CoreWebView2BrowsingDataKinds.DiskCache or CoreWebView2BrowsingDataKinds.AllProfile in the dataKinds to clear.
  • The hang will not occur in 112.0.1722.48 if you navigate to a website prior to selecting "Scenario->Clear Browsing Data->All Profile".
  • The hang also occurs when using earlier versions of the SDK (e.g. 1.0.1661.34) and later pre-release versions of the SDK (e.g. 1.0.1777-prerelease)

Please could you confirm and advise.

Thanks

AB#45140130

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.