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

fix(WebView): [macOs] [WKNavigationAction userActivity]: unrecognized… selector sent to instance #8683

Conversation

workgroupengineering
Copy link
Contributor

GitHub Issue (If applicable): closes #8682

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@workgroupengineering workgroupengineering requested a review from a team May 4, 2022 08:11
@gitpod-io
Copy link

gitpod-io bot commented May 4, 2022

@@ -838,6 +838,21 @@ public override void DidFailProvisionalNavigation(WKWebView webView, WKNavigatio
}
}
}

public override void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction, WKWebpagePreferences preferences, Action<WKNavigationActionPolicy, WKWebpagePreferences> decisionHandler)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be invoking back this method:

public override void DecidePolicy(WKWebView webView, WKNavigationAction navigationAction, Action<WKNavigationActionPolicy> decisionHandler)

It's curious that we have not seen this before on iOS.

To limit the impact, I'd suggest to keep this method macOS specific for now.

It may override/interact the behavior for the other ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just starting out with the Apple world. Based on the documentation found here, if it is not implemented, the runtime calls webView: decidePolicyForNavigationAction: decisionHandler :.
I tried to copy the DecidePolicy logic to this overload and the problem persists. So the problem is in DecidePolicy which does not implement the specific case, not for the missing of the overaide of the olverload.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeromelaban the issue is present only on c.i.. Do you have any idea what this might depend on?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which issue are you mentioning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run macOS UI Snapshot Tests of PR #7830 crash if not add this change. See this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I missed that part. Yes, so those issues are generally happening when the managed object has been collected, but the native instance still wants to interact with it. This generally means that the target instance is not rooted properly in the class that created the instance.

@workgroupengineering
Copy link
Contributor Author

fixed by #8854

@workgroupengineering workgroupengineering deleted the fixes/SemplesApp/macOS/WebView/unrecognized-selector branch May 24, 2022 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants