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

Features/keep contacts in sync #6697

Merged
merged 1 commit into from
Nov 14, 2018
Merged

Conversation

cammellos
Copy link
Contributor

@cammellos cammellos commented Nov 13, 2018

Summary:

Once two devices are paired, contacts are kept in sync by sending an updated sync message every time we send/accept a contact request.

Areas that maybe impacted (optional)

Functional

  • contact requests

Only the last commit needs reviewing

status: ready

@cammellos cammellos added the chat label Nov 13, 2018
@cammellos cammellos self-assigned this Nov 13, 2018
@status-github-bot
Copy link

status-github-bot bot commented Nov 13, 2018

Pull Request Checklist

  • Have you updated the documentation, if impacted (e.g. docs.status.im)?

@status-comment-bot
Copy link

✅ CI BUILD SUCCESSFUL

Jenkins job: #3

Mobile
Desktop

@statustestbot
Copy link

75% of end-end tests have passed

Total executed tests: 60
Failed tests: 15
Passed tests: 45

Failed tests (15)

Click to expand
1. test_request_and_receive_tokens_in_1_1_chat

Device 1: Tap on SignTransactionButton
Device 1: Wait for EnterPasswordInput

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

Device sessions

2. test_text_message_1_1_chat

Device 2: Wait for ChatMessageInput
Device 2: Looking for a message by text: 'hello'

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

Device sessions

3. test_add_to_contacts

Device 1: Type 'hello' to ChatMessageInput
Device 1: Tap on SendMessageButton

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

Device sessions

4. test_unread_messages_counter_1_1_chat

Device 2: Tap on SendMessageButton
Device 1: Counter is 1

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

Device sessions

5. test_offline_messaging_1_1_chat

Device 2: Type 'test message' to ChatMessageInput
Device 2: Tap on SendMessageButton

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

Device sessions

6. test_request_and_receive_eth_in_1_1_chat

Device 1: Tap on SignTransactionButton
Device 1: Wait for EnterPasswordInput

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

Device sessions

7. test_swipe_to_delete_public_chat

Device 1: Wait for ConnectionStatusText
Device 1: Wait for ConnectionStatusText

Device 1: Unable to find chat with user #hqiyxew

Device sessions

8. test_messaging_in_different_networks

Device 2: Wait for ChatMessageInput
Device 2: Looking for a message by text: 'test message'

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

Device sessions

9. test_send_tokens_in_1_1_chat

Device 2: Looking for a message by text: '0.0111318239'
Device 2: Wait for ChatElementByText

Message with the sent amount is not shown for the recipient

Device sessions

10. test_network_mismatch_for_send_request_commands

Device 1: Tap on GotItButton
Device 1: Looking for a message by text: '0.0111318195'

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

Device sessions

11. test_swipe_to_delete_1_1_chat

Device 1: Wait for ConnectionStatusText
Device 1: Wait for ConnectionStatusText

Device 1: Unable to find chat with user Little Weighty Iberianmol

Device sessions

12. test_send_eth_in_1_1_chat

Device 2: EthAssetText is 4.65745720738
Device 2: Transaction received, balance updated!

Message with the sent amount is not shown for the recipient

Device sessions

13. test_send_message_to_newly_added_contact

Device 1: Type 'hello' to ChatMessageInput
Device 1: Tap on SendMessageButton

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

Device sessions

14. test_unread_messages_counter_public_chat

Device 2: Tap on SendMessageButton
Device 1: Counter is 1

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

Device sessions

15. test_request_eth_in_wallet

Device 2: Wait for ChatMessageInput
Device 2: Looking for a message by text: '0.01113182344'

Request funds message was not received

Device sessions

Passed tests (45)

Click to expand
1. test_create_account
Device sessions

2. test_user_can_switch_network
Device sessions

3. test_filters_from_daap
Device sessions

4. test_copy_and_paste_messages
Device sessions

5. test_send_transaction_from_daap
Device sessions

6. test_delete_cut_and_paste_messages
Device sessions

7. test_deploy_contract_from_daap
Device sessions

8. test_offline_login
Device sessions

9. test_pass_phrase_validation
Device sessions

10. test_public_chat_messaging
Device sessions

11. test_back_forward_buttons_browsing_website
Device sessions

12. test_password_in_logcat_sign_in
Device sessions

13. test_set_profile_picture
Device sessions

14. test_logcat_send_transaction_from_daap
Device sessions

15. test_onboarding_screen_when_requesting_tokens_for_new_account
Device sessions

16. test_logcat_send_transaction_from_wallet
Device sessions

17. test_send_token_with_7_decimals
Device sessions

18. test_modify_transaction_fee_values
Device sessions

19. test_token_with_more_than_allowed_decimals
Device sessions

20. test_send_eth_from_wallet_to_address
Device sessions

21. test_send_transaction_details_in_1_1_chat
Device sessions

22. test_manage_assets
Device sessions

23. test_wallet_set_up
Device sessions

24. test_logcat_send_transaction_in_1_1_chat
Device sessions

25. test_passphrase_whitespaces_ignored_while_recovering_access
Device sessions

26. test_send_emoji
Device sessions

27. test_add_contact_by_pasting_public_key
Device sessions

28. test_logcat_recovering_account
Device sessions

29. test_logcat_sign_message_from_daap
Device sessions

30. test_switch_users_and_add_new_account
Device sessions

31. test_send_stt_from_wallet
Device sessions

32. test_login_with_new_account
Device sessions

33. test_send_eth_from_wallet_to_contact
Device sessions

34. test_add_contact_from_public_chat
Device sessions

35. test_send_request_not_enabled_tokens
Device sessions

36. test_password_in_logcat_creating_account
Device sessions

37. test_backup_recovery_phrase
Device sessions

38. test_offline_status
Device sessions

39. test_open_google_com_via_open_dapp
Device sessions

40. test_sign_message_from_daap
Device sessions

41. test_user_can_remove_profile_picture
Device sessions

42. test_share_contact_code_and_wallet_address
Device sessions

43. test_refresh_button_browsing_app_webview
Device sessions

44. test_backup_recovery_phrase_warning_from_wallet
Device sessions

45. test_recover_account
Device sessions

@cammellos cammellos force-pushed the features/keep-contacts-in-sync branch from f25e41f to 16b0fc9 Compare November 14, 2018 07:29
@status-comment-bot
Copy link

✅ CI BUILD SUCCESSFUL

Jenkins job: #4

Mobile
Desktop

@cammellos
Copy link
Contributor Author

@churik latest build does not show your own messages as new (the same in public chat), it was a regression introduced by a refactoring PR.

@churik churik self-assigned this Nov 14, 2018
@asemiankevich
Copy link
Contributor

@cammellos i have noticed sync is not being done in the following case:

  1. Install release build android
  2. Install release build ios
  3. recover account ios and android builds
  4. upgrade android and ios to current PR
  5. install nightly build desktop
  6. recover same account on desktop
  7. install current PR on desktop as upgrade
  8. login on android and go to test-team chat. Add someone to contacts (for ex Chad)
  9. login on ios
  10. on android and ios: Profile-Devices - pair devices - sync all (tap on both devices)
  11. make sure the contact added in step 8 is present on ios and android now
  12. go to desktop and tap pair devices
  13. enable sync on desktop for 2 mobile devices (ios and android)
  14. tap sync all devices on desktop
  15. make sure contact from step 8 present on desktop now

Actual result: contact added on step 8 is not synced on desktop and not present there in contact list.

Could you please take a look? cc @churik

@cammellos
Copy link
Contributor Author

@asemiankevich sorry just to make sure, sync it's a one directional thing.

I am assuming all devices are paired & enabled here.

So when you click on Sync all on Desktop all contacts on Desktop should be seen on ios & android. If you click on Sync all on android all contacts on android will be shared on ios & desktop etc.

Here it seems contact-8 is not present on desktop, correct?

If you click on sync-all on desktop you should not see contact-8 on desktop. But if you click on sync-all on mobile (where contact-8 is), you should see it on desktop.

Is that the case or I misunderstood?

@asemiankevich
Copy link
Contributor

yes, that is correct @cammellos and i tapped sync all on all devices and contact from step 8 never appeared on desktop (

also 1 more question - i need to sync devices manually all the time i add new contacts/ chats across devices?

@cammellos
Copy link
Contributor Author

@asemiankevich no, once paired, they are kept in sync, but it works in the same way as messages, so if for example one device is offline for too long and the message is not on the mailserver, that contact won't be synced etc.
I will ask you for logs, in pm, so don't throw away anything :)

@asemiankevich
Copy link
Contributor

@asemiankevich
Copy link
Contributor

@cammellos i have created group chat from mobile device with you. Added you as a contact on ios. Android shows me you in contacts too (good). Desktop does not show either group chat or you as a contact.

@cammellos
Copy link
Contributor Author

@asemiankevich ping me on status or here when you have 10 mins, I would like to try out something, thanks!

@churik
Copy link
Member

churik commented Nov 14, 2018

@asemiankevich I followed your steps and between 14 and 15 should be one step more: tap on "Sync all" from IOS or Android devices, because new device (desktop) was added.

Tried to reproduce from scratch 2 times, and I always have new contact on desktop after I tap on IOS or Android "Sync all" (after 14 step).

But if you say that you tapped on IOS (or Android) "Sync all" after 14 step and nothing appears on desktop - it is device specific or contact-specific and only @cammellos can help

@asemiankevich
Copy link
Contributor

@churik i spoke with @cammellos and seems we can merge with this , it is very hard to repro now and definitely not crucial. We can report it later once i can repro it 100%

@churik
Copy link
Member

churik commented Nov 14, 2018

Automated tests failures are unrelated to PR.
Tested on 4 devices - IOS, Android, Linux, Mac OSx (fresh install and upgrade)

  • contacts are syncing (when one of device was offline, then go online is also checked)
  • your messages in 1-1 chats are syncing and didn't mark as read (when one of device was offline, then go online is also checked)
  • your messages in group chats are syncing across devices (when one of device was offline, then go online is also checked)

Aren't synced:

  • contact pictures (known, will be added as a separate issue)
  • reading messages (if you read some of the messages on device1, the will still be displayed as unread on other devices) - also add as a feature request
  • deleting chats/clearing history/public chats (if you join from device1 to public chat, you will not see it until you join it on device2)
  • profile name/picture/settings

Known behavior:

  • if you disable sync in one of the devices, then send from it some messages to 1-1 chat, then enable sync - you will not see messages that you send while sync was disabled
  • to start using sync, you need to discover (tap on + on mobile under "Devices" or on "Pair this device" on the desktop) your device to other devices, then enable sync on other devices and tap on "Sync all". It is made to start sync on all devices. Should be done only once.
  • old history for chats (which were created before sync was introduced) wouldn't be synced.
    So for example if I had a chat with User A created 01/10/2018 on device1 and have messages only from him because all this time I chatted from device2, then I enable sync - I'll see only my new messages on all devices - the previous history wasn't synced.
  • devices names will be more recognizable with time, will create separate issue for this
  • now sync is limited to 5 devices

@churik
Copy link
Member

churik commented Nov 14, 2018

And we can close #6658 I think

@cammellos cammellos force-pushed the features/keep-contacts-in-sync branch 2 times, most recently from 397e17e to b5fd67e Compare November 14, 2018 12:20
Everytime a contact request is sent/confirmed a sync message is also
sent to other devices so the contact is kept in sync.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
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.

8 participants