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

[#9986] Allow to disable fetching of tx history on mobile network #11007

Merged
merged 1 commit into from
Aug 15, 2020

Conversation

rasom
Copy link
Contributor

@rasom rasom commented Jul 29, 2020

The esiest way to test it would be to compare data usage on release version and this one. You would need to switch to mobile network, select "stop syncing", and then keep app in the foreground for 5mins.

fixes #9986

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Jul 29, 2020

Jenkins Builds

Click to see older builds (36)
Commit #️⃣ Finished (UTC) Duration Platform Result
5641151 #1 2020-07-29 09:27:50 ~23 sec android-e2e 📄log
5641151 #1 2020-07-29 09:27:53 ~25 sec android 📄log
5641151 #1 2020-07-29 09:28:00 ~30 sec ios 📄log
✔️ 0a638c1 #2 2020-07-29 09:53:03 ~16 min android-e2e 📦apk 📲
✔️ 0a638c1 #2 2020-07-29 09:53:09 ~16 min android 📦apk 📲
✔️ 0a638c1 #2 2020-07-29 09:54:01 ~16 min ios 📦ipa 📲
✔️ fbe8ccf #3 2020-07-29 11:44:44 ~11 min android-e2e 📦apk 📲
✔️ fbe8ccf #3 2020-07-29 11:44:51 ~11 min android 📦apk 📲
✔️ fbe8ccf #3 2020-07-29 11:47:15 ~14 min ios 📦ipa 📲
✔️ 7c6364d #4 2020-07-29 12:12:25 ~15 min android-e2e 📦apk 📲
✔️ 7c6364d #4 2020-07-29 12:12:35 ~15 min android 📦apk 📲
✔️ 7c6364d #5 2020-07-29 12:37:37 ~14 min ios 📦ipa 📲
✔️ 9bcbb4a #5 2020-07-29 13:45:49 ~15 min android-e2e 📦apk 📲
✔️ 9bcbb4a #5 2020-07-29 13:46:03 ~15 min android 📦apk 📲
✔️ 9bcbb4a #6 2020-07-29 13:46:42 ~16 min ios 📦ipa 📲
✔️ 41f00f9 #6 2020-07-30 08:48:04 ~12 min android-e2e 📦apk 📲
✔️ 41f00f9 #6 2020-07-30 08:50:24 ~14 min android 📦apk 📲
✔️ 41f00f9 #7 2020-07-30 08:51:43 ~15 min ios 📦ipa 📲
✔️ 0d30d3a #7 2020-07-30 18:25:10 ~12 min android-e2e 📦apk 📲
✔️ 0d30d3a #7 2020-07-30 18:25:23 ~12 min android 📦apk 📲
✔️ 0d30d3a #8 2020-07-30 18:28:31 ~15 min ios 📦ipa 📲
✔️ 0752508 #8 2020-08-06 08:25:57 ~17 min android-e2e 📦apk 📲
✔️ 0752508 #8 2020-08-06 08:25:57 ~17 min android 📦apk 📲
✔️ 0752508 #9 2020-08-06 08:26:11 ~17 min ios 📦ipa 📲
1fa231b #10 2020-08-07 11:13:17 ~6 min ios 📄log
1fa231b #9 2020-08-07 11:22:34 ~15 min android-e2e 📄log
1fa231b #9 2020-08-07 11:22:41 ~15 min android 📄log
2deffd8 #10 2020-08-10 09:16:11 ~9 min android 📄log
2deffd8 #10 2020-08-10 09:18:42 ~12 min android-e2e 📄log
2deffd8 #11 2020-08-10 09:23:02 ~16 min ios 📄log
✔️ 0154de2 #11 2020-08-11 09:53:23 ~14 min android 📦apk 📲
✔️ 0154de2 #11 2020-08-11 09:53:29 ~14 min android-e2e 📦apk 📲
✔️ 0154de2 #12 2020-08-11 09:53:38 ~14 min ios 📦ipa 📲
✔️ 125e9a6 #12 2020-08-12 12:27:34 ~13 min android-e2e 📦apk 📲
✔️ 125e9a6 #12 2020-08-12 12:27:50 ~13 min android 📦apk 📲
✔️ 125e9a6 #13 2020-08-12 12:28:12 ~13 min ios 📦ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ f5c41ed #13 2020-08-13 12:07:43 ~14 min android 📦apk 📲
✔️ f5c41ed #13 2020-08-13 12:07:51 ~14 min android-e2e 📦apk 📲
✔️ f5c41ed #14 2020-08-13 12:12:03 ~18 min ios 📦ipa 📲
c2277cb #15 2020-08-15 18:42:50 ~7 min ios 📄log
✔️ c2277cb #14 2020-08-15 18:48:53 ~13 min android-e2e 📦apk 📲
✔️ c2277cb #14 2020-08-15 18:48:58 ~13 min android 📦apk 📲

@rasom rasom self-assigned this Jul 29, 2020
@rasom rasom force-pushed the stop-wallet branch 4 times, most recently from 7c6364d to 9bcbb4a Compare July 29, 2020 13:30
@rasom rasom marked this pull request as ready for review July 29, 2020 13:30
@rasom rasom requested review from jakubgs and a team as code owners July 29, 2020 13:30
@hesterbruikman
Copy link
Contributor

@rasom This is a good solution. Didn't learn too much about bandwidth use in target markets unfortunately, but anyway we can reduce and give control makes sense. Does Force start enable syncing over mobile data?

@errorists what are your thoughts on Enable/Disable message syncing and tx syncing over mobile data? Should this be a single setting or should both be controlled separately? As this impacts Settings and the Sync over Mobile bottom sheet

@errorists
Copy link
Contributor

@hesterbruikman it should be a single setting and unified with the chat dialogues

@rasom
Copy link
Contributor Author

rasom commented Aug 6, 2020

@hesterbruikman @errorists
Done, fetching of tx history is disabled/enabled on mobile with the same setting as message history.

@hesterbruikman
Copy link
Contributor

🙌 great! Thanks @rasom

I think this needs minor copy changes to accurately represent the mobile data switch. What do you think of below @errorists @rasom This is the fastest route I can think of to include in this PR. You might want to better organize the sync settings though. If so I'll create a separate issue

Note that white line in the bottom sheet is weird 🤔

Frame 1

@rasom
Copy link
Contributor Author

rasom commented Aug 7, 2020

@hesterbruikman
translations are fixed (though EN only)

You might want to better organize the sync settings though. If so I'll create a separate issue

We could have two options there:

  1. keep syncing both messages and transactions
  2. keep syncing only messages

As far as I understand currently wallet requires much more traffic than messages (@cammellos @oskarth do you confirm?). There are many users who use the app as a messenger in the first place, not as a wallet. For them it might make sense to keep syncing only messages history. And we can also add a button in wallet which will refresh history on demand without listening to the network (thus without using mobile data constantly).

@hesterbruikman
Copy link
Contributor

hesterbruikman commented Aug 7, 2020

And we can also add a button in wallet which will refresh history on demand without listening to the network (thus without using mobile data constantly).

If you're feeling adventurous, this is a long outstanding issue to reduce frequency of fetching and include fetching on demand: #10242 (pull to refresh). Having this manual fetching, I think we could keep the mobile data setting a catch all mobile sync for messaging and tx

Mobile data

  • Enable - auto-sync messages and tx when on mobile network, pull to refresh available in addition
  • Disable - does not sync messages and tx prompt settings bottom sheet when:_
    • switching to mobile network
    • attempting pull to refresh
  • Data saver - syncs tx on pull to refresh only

Potential addition to the original design of pull to refresh could be:
If user pulls to refresh while on mobile data, UI could prompt the Sync using mobile data? currently used for messaging

@rasom
Copy link
Contributor Author

rasom commented Aug 10, 2020

@hesterbruikman I would merge this PR at first and then take a look at #10242 later

@hesterbruikman
Copy link
Contributor

Sounds good to me. Also without #10242 being able to switch off sync over mobile data for messages and tx is a win if you want to spare your data plan. Let's consider datasaver as a separate feature

@status-im-auto
Copy link
Member

95% of end-end tests have passed

Total executed tests: 97
Failed tests: 5
Passed tests: 92

Failed tests (5)

Click to expand
1. test_user_can_switch_network

Device 1: Wait for OkButton
Device 1: Wait for ContinueButton

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

Device sessions

2. test_push_notification_1_1_chat

Device 2: =========================================================================
Device 2: Send emoji message to Device 1 while it's on backround

Device 2: 'ChatMessageInput' is not found on the screen

Device sessions

3. test_image_in_one_to_one_send_save_reply

Device 2: Looking for a message by text: 'image reply'
Device 2: Wait for ImageInReply

Image doesn't match expected template for sender Image doesn't match expected template for receiver

Device sessions

4. test_switch_users_and_add_new_account

Device 1: Wait for ContinueButton
Device 1: Wait for OkButton

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

Device sessions

5. test_can_add_existing_ens

Device 1: Wait for OkButton
Device 1: Wait for ContinueButton

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

Device sessions

Passed tests (92)

Click to expand
1. test_request_public_key_status_test_daap
Device sessions

2. test_open_public_chat_using_deep_link
Device sessions

3. test_ens_username_recipient
Device sessions

4. test_keycard_can_see_all_transactions_in_history
Device sessions

5. test_offline_status
Device sessions

6. test_open_transaction_on_etherscan
Device sessions

7. test_open_chat_by_pasting_public_key
Device sessions

8. test_back_forward_buttons_browsing_website
Device sessions

9. test_password_in_logcat_creating_account
Device sessions

10. test_can_use_purchased_stickers_on_recovered_account
Device sessions

11. test_insufficient_funds_wallet_positive_balance
Device sessions

12. test_mobile_data_usage_settings
Device sessions

13. test_open_google_com_via_open_dapp
Device sessions

14. test_logcat_backup_recovery_phrase
Device sessions

15. test_unread_messages_counter_public_chat
Device sessions

16. test_send_two_transactions_one_after_another_in_dapp
Device sessions

17. test_public_chat_clear_history
Device sessions

18. test_wallet_set_up
Device sessions

19. test_timestamp_in_chats
Device sessions

20. test_delete_chats_via_delete_button
Device sessions

21. test_add_account_to_multiaccount_instance_seed_phrase
Device sessions

22. test_fetch_more_history_in_empty_chat
Device sessions

23. test_mobile_data_usage_popup_continue_syncing
Device sessions

24. test_keycard_fetching_balance_after_offline
Device sessions

25. test_add_to_contacts
Device sessions

26. test_dapps_permissions
Device sessions

27. test_long_press_delete_clear_all_dapps
Device sessions

28. test_need_help_section
Device sessions

29. test_transaction_wrong_password_wallet
Device sessions

30. test_offline_messaging_1_1_chat
Device sessions

31. test_add_account_to_multiaccount_instance_private_key
Device sessions

32. test_text_message_1_1_chat
Device sessions

33. test_install_pack_and_send_sticker
Device sessions

34. test_send_eth_in_1_1_chat
Device sessions

35. test_pair_devices_sync_one_to_one_contacts_public_chat
Device sessions

36. test_send_emoji
Device sessions

37. test_copy_and_paste_messages
Device sessions

38. test_keycard_send_eth_in_1_1_chat
Device sessions

39. test_restore_account_from_mnemonic_to_keycard
Device sessions

40. test_add_account_to_multiaccount_instance_generate_new
Device sessions

41. test_send_eth_from_wallet_to_address
Device sessions

42. test_messaging_in_different_networks
Device sessions

43. test_start_chat_with_ens
Device sessions

44. test_logcat_recovering_account
Device sessions

45. test_offline_add_new_group_chat_member
Device sessions

46. test_connection_is_secure
Device sessions

47. test_keycard_send_transaction_from_daap
Device sessions

48. test_user_can_see_all_own_assets_after_account_recovering
Device sessions

49. test_send_eth_to_ens_in_chat
Device sessions

50. test_keycard_sign_message_from_daap
Device sessions

51. test_long_press_to_delete_chat
Device sessions

52. test_add_and_remove_contact_from_public_chat
Device sessions

53. test_send_transaction_from_daap
Device sessions

54. test_onboarding_screen_when_requesting_tokens_for_recovered_account
Device sessions

55. test_keycard_send_eth_from_wallet_to_address
Device sessions

56. test_keycard_send_two_transactions_one_after_another_in_dapp
Device sessions

57. test_add_and_delete_watch_only_account_to_multiaccount_instance
Device sessions

58. test_open_blocked_site
Device sessions

59. test_refresh_button_browsing_app_webview
Device sessions

60. test_public_chat_messaging
Device sessions

61. test_pass_phrase_validation
Device sessions

62. test_send_token_with_7_decimals
Device sessions

63. test_sign_message_from_daap
Device sessions

64. test_recover_account_from_new_user_seedphrase
Device sessions

65. test_add_new_keycard_account_and_login
Device sessions

66. test_decline_transactions_in_1_1_chat
Device sessions

67. test_send_and_open_links
Device sessions

68. test_manage_assets
Device sessions

69. test_share_contact_code_and_wallet_address
Device sessions

70. test_send_transaction_with_custom_token
Device sessions

71. test_keycard_send_eth_to_ens (TestRail link is not found)
Device sessions

72. test_can_recover_keycard_account_card_pairing
Device sessions

73. test_request_and_receive_stt_in_1_1_chat_offline
Device sessions

74. test_redirect_to_public_chat_tapping_tag_message
Device sessions

75. test_block_user_from_public_chat
Device sessions

76. test_ens_in_public_and_1_1_chats
Device sessions

77. test_create_new_group_chat
Device sessions

78. test_password_in_logcat_sign_in
Device sessions

79. test_account_recovery_with_uppercase_recovery_phrase
Device sessions

80. test_mobile_data_usage_popup_stop_syncing
Device sessions

81. test_send_non_english_message_to_newly_added_contact
Device sessions

82. test_collectible_from_wallet_opens_in_browser_view
Device sessions

83. test_contact_profile_view
Device sessions

84. test_keycard_send_two_transactions_in_batch_in_dapp
Device sessions

85. test_send_two_transactions_in_batch_in_dapp
Device sessions

86. test_filters_from_daap
Device sessions

87. test_login_with_new_account
Device sessions

88. test_home_view
Device sessions

89. test_log_level_and_fleet
Device sessions

90. test_copy_contact_code_and_wallet_address
Device sessions

91. test_fetching_balance_after_offline
Device sessions

92. test_can_see_all_transactions_in_history
Device sessions

@churik
Copy link
Member

churik commented Aug 12, 2020

@rasom

ISSUE / QUESTION 1 IOS vs Android - different behavior

Steps:

  1. turn off WI-FI (LTE on IOS, 4G on Android)
  2. restore account with transaction history

On IOS(LTE):

  • initial scanning: transaction history is not loaded, usage: 1,8 MB on current PR build vs 1,7 MB on release build
  • foreground for 5 mins: 0,4 MB on current PR build vs 11,3 MB on release build

on Android(4G+):

  • initial scanning: transaction history is loaded very quickly, usage: 12,9 MB on current PR build VS 13,2 on release build
  • foreground for 5 mins: 7.1 MB on current PR build vs 5,3 MB on release build
    So not sure that feature is working on Android (note: automatic lock is turned on on Android, so can be that app was on background for a couple of moments)

Logs from PR build, Android: Status-debug-logs.zip

ISSUE 2 On IOS when creating account on mobile network after enabling wifi transaction history is not loaded until app restart (also in nightly)

As it is an issue in nightly as well, can be reported separately, so it is in case you can take a look in this PR into this.
Steps:

  1. turn off WI-FI (LTE on IOS)
  2. restore account with transaction history
  3. enable wi-fi

Expected result: transaction history is loaded
Actual result: transaction history is not loaded until app restart
Log: status_logs.zip

@rasom
Copy link
Contributor Author

rasom commented Aug 12, 2020

ISSUE 2 On IOS

is issue 2 iOS specific?

@churik
Copy link
Member

churik commented Aug 12, 2020

It is not reproducible on Android, only on IOS. Tried on IOS 13.5.1, however, can try on another IOS versions if it makes sense

@rasom
Copy link
Contributor Author

rasom commented Aug 13, 2020

@churik both issues should be fixed now

@churik churik self-assigned this Aug 14, 2020
@status-im-auto
Copy link
Member

75% of end-end tests have passed

Total executed tests: 4
Failed tests: 1
Passed tests: 3

Failed tests (1)

Click to expand
1. test_can_add_existing_ens

Device 1: Scrolling down to ENSusernames
Device 1: Scrolling down to ENSusernames

Device 1: 'ENSusernames' is not found on the screen; also Unexpected Alert is shown: 'Ethereum node was started with incorrect configuration, application will be stopped to recover from that condition. Configured network id = 3, actual = 1'

Device sessions

Passed tests (3)

Click to expand
1. test_user_can_switch_network
Device sessions

2. test_switch_users_and_add_new_account
Device sessions

3. test_image_in_one_to_one_send_save_reply
Device sessions

@status-im-auto
Copy link
Member

100% of end-end tests have passed

Total executed tests: 1
Failed tests: 0
Passed tests: 1

Passed tests (1)

Click to expand
1. test_can_add_existing_ens
Device sessions

@churik
Copy link
Member

churik commented Aug 14, 2020

Android:
Initial scanning: 158 KB on current PR build VS 13,2 MB on release build
Foreground 5 min (with coming back to background and back): 409 KB (2 messages in 1-1 chat were received) on current PR build vs 5,3 MB on release build
IOS:
Initial scanning: 150 KB on current PR build VS 1,7 MB on release build
Foreground 5 min (with coming back to background and back): 100 KB vs 11,3 MB on release build

Messaging in 1-1 chats is still working while on 3G network.
Checked, that transactions are downloaded when turning in WI-Fi or start syncing and disabled again when turning it off.

GREAT WORK!

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.

Allow to disable fetching of tx history on mobile network
6 participants