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

Use community WebView #10090

Merged
merged 1 commit into from
Mar 24, 2020
Merged

Use community WebView #10090

merged 1 commit into from
Mar 24, 2020

Conversation

vitvly
Copy link
Contributor

@vitvly vitvly commented Feb 27, 2020

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@status-github-bot
Copy link

Pull Request Checklist

  • Docs: Updated the documentation, if affected
  • Docs: Added or updated inline comments explaining intention of the code
  • Tests: Ensured that all new UI elements have been assigned accessibility IDs
  • Tests: Signaled need for E2E tests with label, if applicable
  • Tests: Briefly described what was tested and what platforms were used
  • UI: In case of UI changes, ensured that UI matches Figma
  • UI: In case of UI changes, requested review from a Core UI designer
  • UI: In case of UI changes, included screenshots of implementation

@status-im-auto
Copy link
Member

status-im-auto commented Feb 27, 2020

Jenkins Builds

Click to see older builds (48)
Commit #️⃣ Finished (UTC) Duration Platform Result
032f4a6 #1 2020-02-27 11:21:26 ~5 min android-e2e 📄log
032f4a6 #1 2020-02-27 11:21:32 ~5 min android 📄log
032f4a6 #1 2020-02-27 11:29:04 ~13 min ios 📄log
c3c9d39 #2 2020-02-27 17:27:41 ~9 min android 📄log
c3c9d39 #2 2020-02-27 17:27:43 ~9 min android-e2e 📄log
c3c9d39 #2 2020-02-27 17:28:11 ~9 min ios 📄log
c3c9d39 #3 2020-02-27 20:40:28 ~8 min android 📄log
d63dd85 #4 2020-02-27 20:56:54 ~8 min android 📄log
d63dd85 #3 2020-02-27 20:56:58 ~8 min android-e2e 📄log
d63dd85 #3 2020-02-27 20:57:43 ~9 min ios 📄log
3df3fc2 #4 2020-03-02 10:54:50 ~40 sec ios 📄log
3df3fc2 #5 2020-03-02 10:54:52 ~44 sec android 📄log
3df3fc2 #4 2020-03-02 10:54:55 ~50 sec android-e2e 📄log
✔️ b3d0c5a #5 2020-03-02 11:09:22 ~10 min ios 📦ipa 📲
✔️ b3d0c5a #6 2020-03-02 11:13:34 ~15 min android 📦apk 📲
✔️ b3d0c5a #5 2020-03-02 11:13:34 ~15 min android-e2e 📦apk 📲
✔️ 5e5eb0b #6 2020-03-02 13:26:24 ~11 min ios 📦ipa 📲
✔️ 5e5eb0b #7 2020-03-02 13:29:38 ~14 min android 📦apk 📲
✔️ 5e5eb0b #6 2020-03-02 13:29:38 ~14 min android-e2e 📦apk 📲
c2890c4 #8 2020-03-18 09:50:31 ~27 sec android-e2e 📄log
c2890c4 #9 2020-03-18 09:50:37 ~29 sec android 📄log
✔️ c2890c4 #8 2020-03-18 09:59:35 ~9 min ios 📦ipa 📲
✔️ c2890c4 #10 2020-03-18 10:52:43 ~11 min android 📦apk 📲
✔️ b55422e #9 2020-03-18 12:20:22 ~8 min ios 📦ipa 📲
✔️ b55422e #9 2020-03-18 12:23:00 ~11 min android-e2e 📦apk 📲
✔️ b55422e #11 2020-03-18 12:23:06 ~11 min android 📦apk 📲
✔️ e28f8ed #10 2020-03-18 15:49:14 ~8 min ios 📦ipa 📲
✔️ e28f8ed #10 2020-03-18 15:51:24 ~10 min android-e2e 📦apk 📲
✔️ e28f8ed #12 2020-03-18 15:51:26 ~10 min android 📦apk 📲
✔️ b3298db #11 2020-03-20 12:36:33 ~9 min ios 📦ipa 📲
✔️ b3298db #11 2020-03-20 12:37:34 ~10 min android-e2e 📦apk 📲
✔️ b3298db #13 2020-03-20 12:37:35 ~10 min android 📦apk 📲
6d52500 #13 2020-03-20 20:02:09 ~29 sec ios 📄log
✔️ 6d52500 #13 2020-03-20 20:13:17 ~11 min android-e2e 📦apk 📲
✔️ 6d52500 #15 2020-03-20 20:15:39 ~14 min android 📦apk 📲
✔️ 6d52500 #14 2020-03-23 09:48:49 ~24 min ios 📦ipa 📲
✔️ 12c4953 #16 2020-03-23 18:11:37 ~8 min ios 📦ipa 📲
✔️ 12c4953 #15 2020-03-23 18:14:10 ~11 min android-e2e 📦apk 📲
✔️ 12c4953 #17 2020-03-23 18:14:16 ~11 min android 📦apk 📲
✔️ 3aac91e #17 2020-03-23 19:18:25 ~9 min ios 📦ipa 📲
✔️ 3aac91e #16 2020-03-23 19:19:14 ~10 min android-e2e 📦apk 📲
✔️ 3aac91e #18 2020-03-23 19:19:32 ~10 min android 📦apk 📲
✔️ d0978f5 #19 2020-03-24 12:05:03 ~8 min ios 📦ipa 📲
✔️ d0978f5 #20 2020-03-24 12:07:46 ~11 min android 📦apk 📲
✔️ d0978f5 #18 2020-03-24 12:07:52 ~11 min android-e2e 📦apk 📲
d4fd0d3 #19 2020-03-24 15:26:15 ~34 sec android-e2e 📄log
d4fd0d3 #21 2020-03-24 15:26:16 ~33 sec android 📄log
✔️ d4fd0d3 #20 2020-03-24 15:37:00 ~11 min ios 📦ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a4fedf5 #21 2020-03-24 15:52:52 ~8 min ios 📦ipa 📲
✔️ a4fedf5 #20 2020-03-24 15:54:51 ~10 min android-e2e 📦apk 📲
✔️ 99f63b0 #22 2020-03-24 16:12:03 ~8 min ios 📦ipa 📲
✔️ 99f63b0 #21 2020-03-24 16:14:20 ~11 min android-e2e 📦apk 📲
✔️ 99f63b0 #23 2020-03-24 16:14:20 ~11 min android 📦apk 📲

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

1 similar comment
@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@jakubgs
Copy link
Member

jakubgs commented Feb 27, 2020

As far as I can tell yarn2nix has no responsibility to run yarn prepare based on:

prepare: Run both BEFORE the package is packed and published, on local npm install without any arguments, and when installing git dependencies (See below). This is run AFTER prepublish, but BEFORE prepublishOnly.
https://docs.npmjs.com/misc/scripts

Which means that the prepare target defined in react-native-webview is supposed to be run before publishing the package, not during installation.

The simplest solution I can see is to create a commit that includes the result of yarn run prepare and tag it for use in our dependencies. Using branches is a horrible idea.

@vitvly
Copy link
Contributor Author

vitvly commented Feb 28, 2020

It does work on a test RN project though, which is weird. Docs say it should run on local npm install, and it seems to work in that case.

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

2 similar comments
@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@flexsurfer flexsurfer changed the title Use community WebView [WIP] Use community WebView Mar 2, 2020
@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@vitvly vitvly self-assigned this Mar 9, 2020
@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@vitvly vitvly marked this pull request as ready for review March 18, 2020 11:00
@vitvly vitvly requested a review from a team as a code owner March 18, 2020 11:00
@vitvly vitvly requested review from flexsurfer and rasom March 18, 2020 11:00
@vitvly vitvly changed the title [WIP] Use community WebView Use community WebView Mar 18, 2020
@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@@ -52,5 +52,6 @@ public ReactNativeHost getReactNativeHost() {
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
WebView.setWebContentsDebuggingEnabled(true);
Copy link
Member

Choose a reason for hiding this comment

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

why BuildConfig.DEBUG_WEBVIEW == "1") isn't used? don't think we want this enabled in release

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, sorry, did not know about the flag. Will fix.

@@ -231,7 +231,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in
}
if (grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
// Permission has been granted. Start camera preview Activity.
com.github.alinz.reactnativewebviewbridge.WebViewBridgeManager.grantAccess(requestCode);
//com.github.alinz.reactnativewebviewbridge.WebViewBridgeManager.grantAccess(requestCode);
Copy link
Member

Choose a reason for hiding this comment

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

could you add a comment in code, why it was commented ?

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 will simply remove the line, it's not used any more.

@@ -21,6 +21,7 @@
# $keytool -genkey -v -keystore ./status-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias status

# Version requirements used throughout the Gradle scripts
kotlinVersion=1.3.11
Copy link
Member

Choose a reason for hiding this comment

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

why is this needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without it, android builds were failing (specifically make run-android command for me). I'll uncomment and will check if it's still reproducible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it's still reproducible:

A problem occurred configuring project ':react-native-webview'.
> Could not resolve all artifacts for configuration ':react-native-webview:classpath'.
   > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50.
     Searched in the following locations:
       - file:/nix/store/2vcnkyzsghmb5l139ndd0kcz2jsjdc5r-status-react-patched-npm-gradle-modules/.m2/repository/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.pom
       - file:/nix/store/2vcnkyzsghmb5l139ndd0kcz2jsjdc5r-status-react-patched-npm-gradle-modules/.m2/repository/org/jetbrains/kotlin/kotlin-gradle-plugin/1.3.50/kotlin-gradle-plugin-1.3.50.jar
     Required by:
         project :react-native-webview

@@ -152,7 +152,7 @@ TODO: updating requires a pod update on iOS

used for touch-id identification

## "react-native-webview-bridge": "git+https://github.com/status-im/react-native-webview-bridge.git#fix/classnames-colision"
## "react-native-webview": "git+https://github.com/status-im/react-native-webview.git#js_injection_before_load"
Copy link
Member

Choose a reason for hiding this comment

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

why #js_injection_before_load ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrong, forgot to replace with a tag instead.

@@ -420,7 +420,10 @@
:browser/send-to-bridge
(fn [{:keys [message webview]}]
(when (and message webview)
(.sendToBridge webview (types/clj->json message)))))
(let [msg (str "ReactNativeWebView.onMessage('"
Copy link
Member

Choose a reason for hiding this comment

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

could you elaborate ? looks weird

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a community-webview way of posting messages in RN->WebView direction. I used a modified version of what was suggested here.
We invoke onMessage fn that is defined in provider.js

@Serhy
Copy link
Contributor

Serhy commented Mar 24, 2020

Looks good to me now. Dap.ps and simpledapp.eth are workoing now. Can send transaction in DApps.
Cookies are supported now fine.
@siphiuel could you rebase develop please (and fix conflicts) and I'll restart e2e tests..

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@vitvly
Copy link
Contributor Author

vitvly commented Mar 24, 2020

@Serhy thanks, rebased

@status-im-auto
Copy link
Member

99% of end-end tests have passed

Total executed tests: 93
Failed tests: 1
Passed tests: 92

Failed tests (1)

Click to expand
1. test_send_two_transactions_in_batch_in_dapp

Device 1: Wait for SignButton
Device 1: Wait for SignButton

Device 1: 'OkButton' is not found on the screen

Device sessions

Passed tests (92)

Click to expand
1. test_delete_chats_via_delete_button
Device sessions

2. test_can_see_all_transactions_in_history
Device sessions

3. test_install_pack_and_send_sticker
Device sessions

4. test_send_message_in_group_chat
Device sessions

5. test_login_with_new_account
Device sessions

6. test_clear_history_of_group_chat_via_group_view
Device sessions

7. test_timestamp_in_chats
Device sessions

8. test_password_in_logcat_sign_in
Device sessions

9. test_logcat_recovering_account
Device sessions

10. test_modify_transaction_fee_values
Device sessions

11. test_public_chat_clear_history (TestRail link is not found)
Device sessions

12. test_need_help_section
Device sessions

13. test_send_and_open_links
Device sessions

14. test_mobile_data_usage_popup_stop_syncing
Device sessions

15. test_mobile_data_usage_settings
Device sessions

16. test_create_new_group_chat
Device sessions

17. test_sign_typed_message
Device sessions

18. test_user_can_switch_network
Device sessions

19. test_mobile_data_usage_popup_continue_syncing
Device sessions

20. test_home_view
Device sessions

21. test_open_google_com_via_open_dapp
Device sessions

22. test_send_message_to_newly_added_contact
Device sessions

23. test_share_contact_code_and_wallet_address
Device sessions

24. test_make_admin_member_of_group_chat
Device sessions

25. test_connection_is_secure
Device sessions

26. test_add_to_contacts
Device sessions

27. test_add_account_to_multiaccount_instance_private_key
Device sessions

28. test_refresh_button_browsing_app_webview
Device sessions

29. test_can_add_existing_ens
Device sessions

30. test_transaction_wrong_password_wallet
Device sessions

31. test_public_chat_messaging
Device sessions

32. test_unread_messages_counter_public_chat
Device sessions

33. test_text_message_1_1_chat
Device sessions

34. test_can_use_purchased_stickers_on_recovered_account
Device sessions

35. test_open_transaction_on_etherscan
Device sessions

36. test_onboarding_screen_when_requesting_tokens_for_recovered_account
Device sessions

37. test_contact_profile_view
Device sessions

38. test_logcat_backup_recovery_phrase
Device sessions

39. test_delete_group_chat_via_delete_button
Device sessions

40. test_start_chat_with_ens
Device sessions

41. test_add_and_remove_contact_from_public_chat
Device sessions

42. test_add_account_to_multiaccount_instance_seed_phrase
Device sessions

43. test_open_blocked_site
Device sessions

44. test_open_chat_by_pasting_public_key
Device sessions

45. test_pair_devices_sync_one_to_one_contacts_public_chat
Device sessions

46. test_ens_username_recipient
Device sessions

47. test_token_with_more_than_allowed_decimals
Device sessions

48. test_fetch_more_history_in_empty_chat
Device sessions

49. test_switch_users_and_add_new_account
Device sessions

50. test_add_account_to_multiaccount_instance_generate_new
Device sessions

51. test_copy_contact_code_and_wallet_address
Device sessions

52. test_send_transaction_from_daap
Device sessions

53. test_send_two_transactions_one_after_another_in_dapp
Device sessions

54. test_message_marked_as_sent_in_1_1_chat
Device sessions

55. test_long_press_delete_clear_all_dapps
Device sessions

56. test_copy_and_paste_messages
Device sessions

57. test_deploy_contract_from_daap
Device sessions

58. test_back_forward_buttons_browsing_website
Device sessions

59. test_password_in_logcat_creating_account
Device sessions

60. test_add_custom_token
Device sessions

61. test_sign_message_from_daap
Device sessions

62. test_group_chat_system_messages
Device sessions

63. test_dapps_permissions
Device sessions

64. test_request_public_key_status_test_daap
Device sessions

65. test_logcat_send_transaction_from_wallet
Device sessions

66. test_long_press_to_delete_chat
Device sessions

67. test_log_level_and_fleet
Device sessions

68. test_add_and_delete_watch_only_account_to_multiaccount_instance
Device sessions

69. test_recover_account_from_new_user_seedphrase (TestRail link is not found)
Device sessions

70. test_ens_in_public_and_1_1_chats
Device sessions

71. test_block_user_from_public_chat
Device sessions

72. test_fetching_balance_after_offline
Device sessions

73. test_logcat_sign_message_from_daap
Device sessions

74. test_offline_status
Device sessions

75. test_wallet_set_up
Device sessions

76. test_manage_assets
Device sessions

77. test_add_new_group_chat_member
Device sessions

78. test_offline_messaging_1_1_chat
Device sessions

79. test_decline_invitation_to_group_chat
Device sessions

80. test_account_recovery_with_uppercase_recovery_phrase
Device sessions

81. test_send_token_with_7_decimals
Device sessions

82. test_user_can_see_all_own_assets_after_account_recovering
Device sessions

83. test_pass_phrase_validation
Device sessions

84. test_send_emoji
Device sessions

85. test_filters_from_daap
Device sessions

86. test_redirect_to_public_chat_tapping_tag_message
Device sessions

87. test_logcat_send_transaction_from_daap
Device sessions

88. test_send_eth_from_wallet_to_address
Device sessions

89. test_send_stt_from_wallet
Device sessions

90. test_messaging_in_different_networks
Device sessions

91. test_collectible_from_wallet_opens_in_browser_view
Device sessions

92. test_insufficient_funds_wallet_positive_balance
Device sessions

@Serhy
Copy link
Contributor

Serhy commented Mar 24, 2020

That on test failed due to known bug which is in develop #10203

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

Signed-off-by: Vitaliy Vlasov <siphiuel@gmail.com>
@dependency-lockfile-snitch
Copy link

mobile/js_files/yarn.lock changed. Pinging @jakubgs and @corpetty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Migration to community WebView
6 participants