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

[Problem/Bug]: Multiple Browser Instances Sharing User Data Folder Cannot Have Different Settings #4593

Open
vrad-joshuamckelvey opened this issue May 28, 2024 · 7 comments
Assignees
Labels
bug Something isn't working regression Something used to work but doesn't anymore

Comments

@vrad-joshuamckelvey
Copy link

What happened?

WebView2 fails to launch when two WebView2 browser instances are sharing the same User Data Folder with differing CoreWebView2EnvironmentOptions.AllowSingleSignOnUsingOSPrimaryAccount values.

The second browser throws the error below:

System.Runtime.InteropServices.COMException: 'The group or resource is not in the correct state to perform the requested operation. (Exception from HRESULT: 0x8007139F)'

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

125.0.2535.67

SDK Version

1.0.2535.41

Framework

Winforms

Operating System

Windows 11

OS Version

10.0.22631

Repro steps

  1. Launch WebView2 in dialog with CoreWebView2EnvironmentOptions.AllowSingleSignOnUsingOSPrimaryAccount set to false.
    L2. Launch WebView2 in another dialog with CoreWebView2EnvironmentOptions.AllowSingleSignOnUsingOSPrimaryAccount set to true.

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Regression in newer Runtime

Last working version (if regression)

124.0.2478.109

@vrad-joshuamckelvey vrad-joshuamckelvey added the bug Something isn't working label May 28, 2024
@github-actions github-actions bot added the regression Something used to work but doesn't anymore label May 28, 2024
@vrad-joshuamckelvey
Copy link
Author

I can provide a demo application as well if that would help.

@vbryh-msft
Copy link
Contributor

It should be by design - it is browser feature. If you are running wv2 with the same UDF they share browser process. Could you please double check that it is working in 124?

@pushkin-
Copy link

@vbryh-msft We have an app which can accept Chromium command line args and pass them through to the WebView2 environment here when creating the environment (the AdditionalBrowserArguments property).

This apps uses the same UDF with different profiles.

This app can run on a server where there are multiple shortcuts running it with different command line arguments that we pass through and multiiple instances of the app running at a time. This leads to this crash.

What is your recommendation for how we can address this? Is our only option to not reuse the user data folder? (we were also thinking to catch this exception and recreate the environment with a secondary UDF to avoid the crash)

@vbryh-msft
Copy link
Contributor

vbryh-msft commented Aug 21, 2024

About webview2 process model - just to make sure we are on the same page.
Multiple profiles for the same UDF are ok.
Just a note, because server with shortcuts was mentioned - Avoid storing user settings on a network drive. This can result in slowdowns, crashes, or loss of data - link.
What are different command line arguments, which are needed?

@pushkin-
Copy link

@vbryh-msft I am using separate profiles but still get this crash. An example is --disable-smooth-scrolling

@SpoilerJones
Copy link

(I work with @pushkin- on this project.) Is the point that our single UDF (despite the separate profiles) means there's only one browser process, shared by multiple (otherwise separate) instances of our app?

@vbryh-msft
Copy link
Contributor

yes - I have linked a doc .

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

No branches or pull requests

5 participants