-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add logs and fixes a race condition in CryptoWebView #1241
Conversation
- Forward errors from CryptoWebView to React Native side to log them - Add a title to CryptoWebView to help finding it on Chrome debugger
@@ -23,6 +23,8 @@ const jsCode = ` | |||
generateHttpServerSecurityKey, | |||
sublteProxy | |||
} | |||
|
|||
postMessage(JSON.stringify({ isReady: true })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si on ralentit le code au dΓ©but de ce jsCode
avec une boucle qui tourne pour rien, onLoadEnd
peut se dΓ©clencher beaucoup trop tΓ΄t.
We use react-native-webview onLoadEnd callback to set the CryptoWebView as ready. It is an important action because other webviews are rendered only when the CryptoWebView is ready. But the onLoadEnd can be triggered before the javascript, where we add our crypto functions, is executed. It is also executed two times (I do not understand why). So here I send a post message from the CryptoWebView to indicate that it is ready. It fixes a race condition we may encounter more and more.
e4a0975
to
4c7939c
Compare
ios/Podfile.lock
Outdated
@@ -1025,7 +1025,7 @@ EXTERNAL SOURCES: | |||
:path: "../node_modules/react-native/ReactCommon/yoga" | |||
|
|||
SPEC CHECKSUMS: | |||
boost: 57d2868c099736d80fcd648bf211b4431e51a558 | |||
boost: 7dcd2de282d72e344012f7d6564d024930a6a440 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should be removed from the PR?
4c7939c
to
c6687d8
Compare
Checklist
Before merging this PR, the following things must have been done if relevant: