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]: ~1% chance calling native-side code from web-side fails with Error: No parameters in result #4881

Open
kiddliu opened this issue Oct 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kiddliu
Copy link

kiddliu commented Oct 24, 2024

What happened?

Datadog RUM tracks our WebView2-based application and for ~1% overall calls from web-side to native-side fails with Error: No parameters in result and it may crash the entire UI. We know the error message may come from v8(/third_party/blink/renderer/bindings/modules/v8/v8_post_remote_object_call_sync_results.cc), it provides little information for debugging purpose. As the reproduction rate is low, it's difficult for us to track the cause.

I find it's quite similar to #4497, is it related to the option ignoreMemberNotFoundError?

Importance

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

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

Evergreen

SDK Version

1.0.1418.22, 1.0.2365.46

Framework

WPF

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps

  1. Create a native class, for example
using System.Runtime.InteropServices;

namespace Foo
{
    [ClassInterface(ClassInterfaceType.None)]
    [ComVisible(true)]
    public sealed class NetworkMonitor : EventListener
    {
        private readonly INetworkMonitorService _networkMonitorService;

        public NetworkMonitor(INetworkMonitorService networkMonitorService)
        {
            _networkMonitorService = networkMonitorService;
            _networkMonitorService.NetworkChanged += OnNetworkChanged;
        }

        private void OnNetworkChanged(object sender, string s)
        {
            DispatchEvent("NetworkChanged", s);
        }

        public bool IsInternetAccess()
        {
            return _networkMonitorService.LastNetworkAvailable;
        }
    }
}
  1. Register it with AddHostObjectToScript
webView.CoreWebView2.AddHostObjectToScript("foo", Singletons.Foo);
  1. Invoke a function of foo right after the page is loaded in WebView2
window.onload = () => {
  console.log(foo.isInternetAccess())
}
  1. For 1% cases, an Error is thrown
Error: No parameters in result: {
 "methodName": "",
 "parameters": null,
 "remoteObjectId": 0
}
  at RemoteMessenger.postSyncRequestMessage @ <anonymous>:1:17256
  at Function.applyHostFunction @ <anonymous>:1:38041
  at Object.apply @ <anonymous>:1:26077
  at Object.apply @ <anonymous>:540:58

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

Don't know

Last working version (if regression)

No response

@kiddliu kiddliu added the bug Something isn't working label Oct 24, 2024
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

No branches or pull requests

1 participant