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

iOS 14.x M1 simulators have a known issue with some standard features #103

Closed
fwx opened this issue Dec 8, 2022 · 9 comments
Closed

iOS 14.x M1 simulators have a known issue with some standard features #103

fwx opened this issue Dec 8, 2022 · 9 comments
Assignees

Comments

@fwx
Copy link

fwx commented Dec 8, 2022

Bug description

Captcha is not displaying puzzle using iOS 14.5 Simulator

To Reproduce

Steps to reproduce the behavior:

  1. Initialize hCaptcha somewhere
  2. Try to call hCaptcha.validate using iOS 14.5 Simulator
  3. That step depends on config.
    If using invisible then nothing happens at all, but if compact is being used, then checkmark displays, but after pressing 'I am a human' nothing happens except one flicker.

Sample code:

captchaWebView?.removeFromSuperview()
        hCaptcha.configureWebView { [weak self] webview in
            self?.captchaWebView = webview
            webview.frame = view.bounds
        }
        
        hCaptcha.validate(on: view) { [weak self] result in
            guard let self = self else {
                return
            }
            print(try! result.dematerialize())
            self.captchaWebView?.removeFromSuperview()
        }

Expected behavior

hCaptcha displays puzzle

Logs

[JS LOG]: challenge executing
[JS LOG]: showing challenge
2022-12-08 23:55:41.012306+1000 APP_NAME[92271:1276150] [ProcessSuspension] 0x12b1b1c80 - ProcessAssertion: Failed to acquire RBS Background assertion 'ConnectionTerminationWatchdog' for process because PID is invalid
2022-12-08 23:55:41.012478+1000 APP_NAME[92271:1276150] [Process] 0x152859018 - [pageProxyID=5, webPageID=6, PID=92278] WebPageProxy::processDidTerminate: (pid 92278), reason 3
2022-12-08 23:55:41.026291+1000 APP_NAME[92271:1276150] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2022-12-08 23:55:41.026374+1000 APP_NAME[92271:1276150] [ProcessSuspension] 0x12b1b1cc0 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 92278, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2022-12-08 23:55:41.029488+1000 APP_NAME[92271:1276150] [Loading] 0x152859018 - [pageProxyID=5, webPageID=6, PID=92278] WebPageProxy::dispatchProcessDidTerminate: reason = 3

Additional context

Seems like thats an iOS bug related to WKWebView. I've tried enabling background capabilities but it didnt help. We have our own implementation of Google's ReCaptcha but I dont see any big difference in codes related to webview handling, so I am not kind of sure thats WKWebView problem

image

@CAMOBAP
Copy link
Collaborator

CAMOBAP commented Dec 25, 2022

Thanks for reporting the issue

I can confirm that permanent we content process termination happens only for 14.5. I have tested 15.5 and 16.2 but no such behavior was observed

This issue really looks like a bug in WebKit (because happens only for specific iOS version)

I will continue the investigation on our side, also SDK shouldn't fail "silent" and provide an error in completion closure (if web content process was killed)

BTW @fwx maybe you have a device with iOS 14.5 to confirm that this behavior happens for the actual device too?

P.S. Issue reproduces only for arm iOS 14.5 (x86_64 14.5 works fine)

@fwx
Copy link
Author

fwx commented Dec 28, 2022

Sorry, but I dont have a device running iOS 14.5 : (

@CAMOBAP
Copy link
Collaborator

CAMOBAP commented Jan 26, 2023

Clearly looks like WebKit issue, because it reproduces on arm Simulator, but works fine for x86_64 Simulator

@CAMOBAP
Copy link
Collaborator

CAMOBAP commented Jan 29, 2023

Now SDK correctly handle WebContent process crash/termination

@e271828-
Copy link
Contributor

Closing for now.

@CAMOBAP CAMOBAP reopened this Mar 9, 2023
@CAMOBAP
Copy link
Collaborator

CAMOBAP commented Mar 9, 2023

Troubleshooting continued

@CAMOBAP
Copy link
Collaborator

CAMOBAP commented Mar 21, 2023

According to our investigation:

Our mobile team finished an investigation about iOS 14 Simulator and it seems it’s a pretty well-known simulator issue related to WebGL, that was not fixed.

As a diagnostic step, you can try to use test sitekeys with hardcoded results: https://docs.hcaptcha.com/#integration-testing-test-keys, which should omit problems with the simulator.
Also, we can suggest testing if functionalities are working on real devices

So per our investigation it's simulator only problem and it's not affect real devices

@fwx could you please try with test sitekeys from https://docs.hcaptcha.com/#integration-testing-test-keys ?

@fwx
Copy link
Author

fwx commented Mar 29, 2023

@CAMOBAP

Sorry for such a long answer. So it is working

[JS LOG]: challenge executing
[JS LOG]: showing challenge
[JS LOG]: challenge got token
[JS LOG]: 10000000-aaaa-bbbb-cccc-000000000001

The captcha was not presented and I just got the token immediately.
iOS 14.5 via iPhone 12 simulator running on Apple's M1 chip, Xcode version is 14.2.

Then I tried one more time and this error happened:

[JS LOG]: challenge executing
[JS LOG]: showing challenge
[JS LOG]: challenge opened
2023-03-29 20:10:27.428918+0700 App-Stage[54360:19363511] [ProcessSuspension] 0x137ab2640 - ProcessAssertion: Failed to acquire RBS Background assertion 'ConnectionTerminationWatchdog' for process because PID is invalid
2023-03-29 20:10:27.429092+0700 App-Stage[54360:19363511] [Process] 0x13aa86018 - [pageProxyID=5, webPageID=6, PID=54365] WebPageProxy::processDidTerminate: (pid 54365), reason 3
2023-03-29 20:10:27.444629+0700 App-Stage[54360:19363511] [assertion] Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}>
2023-03-29 20:10:27.444706+0700 App-Stage[54360:19363511] [ProcessSuspension] 0x137ab2680 - ProcessAssertion: Failed to acquire RBS Background assertion 'WebProcess Background Assertion' for process with PID 54365, error: Error Domain=RBSAssertionErrorDomain Code=3 "Target is not running or required target entitlement is missing" UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target is not running or required target entitlement is missing}
2023-03-29 20:10:27.448214+0700 App-Stage[54360:19363511] [Loading] 0x13aa86018 - [pageProxyID=5, webPageID=6, PID=54365] WebPageProxy::dispatchProcessDidTerminate: reason = 3

Yea I guess we're just looking at Apple's bug and it is probably working on a device running 14.5

@e271828- e271828- changed the title iOS 14.5 blank screen iOS 14.x M1 simulators have a known issue with some standard features Apr 29, 2023
@e271828-
Copy link
Contributor

Let's just add a note to docs, this seems like a known simulator bug that does not affect real devices.

@CAMOBAP CAMOBAP closed this as completed Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants