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/move contacts #8696

Merged
merged 1 commit into from
Aug 7, 2019
Merged

Features/move contacts #8696

merged 1 commit into from
Aug 7, 2019

Conversation

cammellos
Copy link
Contributor

@cammellos cammellos commented Aug 3, 2019

Move contacts to status-go

Contacts are now in status-go, no migration of contacts is provided so all contacts will be lost upon installing this build.

I have left the initialization of filters a bit sketchy (we wait that load-filters is called twice), as the next step will be to avoid calling load-filters altogether, as now that both contacts & chats are in called directly from status-go on loading.

Testing

  • Adding/Removing/Blocking contacts login/logout

depends on #8679 , please review only the last commit

status: ready

@cammellos cammellos requested review from yenda and a team August 3, 2019 13:14
@cammellos cammellos self-assigned this Aug 3, 2019
@auto-assign auto-assign bot removed request for a team August 3, 2019 13:14
@ghost
Copy link

ghost commented Aug 3, 2019

Pull Request Checklist

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

@status-im-auto
Copy link
Member

status-im-auto commented Aug 3, 2019

Jenkins Builds

Click to see older builds (27)
Commit #️⃣ Finished (UTC) Duration Platform Result
0eacbd2 #1 2019-08-03 13:20:40 ~5 min android-e2e 📄 log
✔️ 0eacbd2 #1 2019-08-03 13:26:09 ~11 min android 📦 apk
✔️ 0eacbd2 #1 2019-08-03 13:29:47 ~14 min ios 📦 ipa
0942e3c #2 2019-08-05 14:21:06 ~4 min ios 📄 log
0942e3c #2 2019-08-05 14:32:13 ~16 min android-e2e 📄 log
✔️ 0942e3c #2 2019-08-05 14:37:53 ~21 min android 📦 apk
4b8ead5 #3 2019-08-06 06:55:12 ~6 min android-e2e 📄 log
✔️ 4b8ead5 #3 2019-08-06 07:00:21 ~11 min ios 📦 ipa
✔️ 4b8ead5 #3 2019-08-06 07:01:02 ~12 min android 📦 apk
b5639c4 #4 2019-08-06 07:13:41 ~5 min android-e2e 📄 log
✔️ b5639c4 #4 2019-08-06 07:17:14 ~9 min android 📦 apk
✔️ b5639c4 #4 2019-08-06 07:18:42 ~10 min ios 📦 ipa
b5639c4 #5 2019-08-06 07:57:43 ~12 sec android-e2e 📄 log
fadcbb8 #6 2019-08-06 08:38:54 ~5 min android-e2e 📄 log
✔️ fadcbb8 #5 2019-08-06 08:44:29 ~11 min ios 📦 ipa
✔️ fadcbb8 #5 2019-08-06 08:44:38 ~11 min android 📦 apk
✔️ fadcbb8 #7 2019-08-06 09:19:05 ~9 min android-e2e 📦 apk
dd37480 #6 2019-08-06 14:00:06 ~5 min android 📄 log
✔️ dd37480 #8 2019-08-06 14:05:43 ~11 min android-e2e 📦 apk
✔️ dd37480 #6 2019-08-06 14:05:48 ~11 min ios 📦 ipa
6597130 #9 2019-08-06 14:26:14 ~5 min android-e2e 📄 log
✔️ 6597130 #7 2019-08-06 14:31:47 ~11 min android 📦 apk
✔️ 6597130 #7 2019-08-06 14:31:52 ~11 min ios 📦 ipa
✔️ 6597130 #10 2019-08-07 07:56:20 ~12 min android-e2e 📦 apk
b1938e9 #11 2019-08-07 08:43:49 ~5 min android-e2e 📄 log
✔️ b1938e9 #8 2019-08-07 08:49:07 ~11 min ios 📦 ipa
✔️ b1938e9 #8 2019-08-07 08:49:18 ~11 min android 📦 apk
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ bdbfec6 #9 2019-08-07 11:50:41 ~11 min ios 📦 ipa
✔️ bdbfec6 #9 2019-08-07 11:51:11 ~12 min android 📦 apk
✔️ fe9d4e9 #13 2019-08-07 11:52:02 ~11 min android-e2e 📦 apk

@cammellos cammellos requested review from a team August 3, 2019 16:01
(if config/use-status-go-protocol?
(load-chats-from-rpc cofx)
(initialize-chats-legacy cofx from to)))
(load-chats-from-rpc cofx from -1))
Copy link
Member

Choose a reason for hiding this comment

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

why -1 ?

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 to indicate that we want all the chats, there's pagination but it's not used currently (-1 indicates all the chats)

Copy link
Member

Choose a reason for hiding this comment

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

hm can we use nil? i mean just do not pass this param?

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 can change that, (-1 to indicate no limit is not uncommon in apis though, while 0 might indicate that you want an empty page, null makes the parameter nillable which might not be desirable with integer data types), but if you don't mind I will do that next time I upgrade status-protocol-go (it takes 3 PRs to get stuff in status-react :) , going through 3 review process etc )

@@ -19,6 +19,8 @@
[{:keys [db] :as cofx} chat-id removed-chat-messages]
(let [removed-messages-ids (map :message-id removed-chat-messages)
removed-unseen-count (count (remove :seen removed-chat-messages))
unviewed-messages-count (- (get-in db [:chats chat-id :unviewed-messages-count])
Copy link
Member

Choose a reason for hiding this comment

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

is it nil safe?

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 believe so (- nil 1) = -1

:always
(dissoc :admins :contacts :members-joined)))

(defn- unmarshal-members [{:keys [members chatType] :as chat}]
Copy link
Member

Choose a reason for hiding this comment

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

why do we need all these data transformations on react side? ->rpc and <-rpc ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This data structures come from status-protocol-go which one of its goals is to be agnostic to status-react, so there data-structures are not quite the same, so they need to be "massaged" in shape, we can do this either in status-react or status-go, for now I picked status-react as my understanding is that status-go as well should not have much knowledge of status-react (i.e it should for example serve camelCase json rather than kebab-case which is very clojure specific), but I am happy with both, in any case if we want to change I'd rather do it separately, it should be pretty straightforward to move to status-go.

@cammellos cammellos force-pushed the features/move-contacts branch from 0eacbd2 to 0942e3c Compare August 5, 2019 14:15
@cammellos cammellos force-pushed the features/move-contacts branch from 0942e3c to 4b8ead5 Compare August 6, 2019 06:48
@asemiankevich asemiankevich self-assigned this Aug 6, 2019
@asemiankevich
Copy link
Contributor

@cammellos e2e build fails as well as iOS. Could you please check whats wrong?

@cammellos
Copy link
Contributor Author

@asemiankevich not related to this PR specifically I get:

[2019-08-06T06:52:41.626Z] deleting '/nix/store/64ijkzlijmdiqpn6lvppdivhw3a9nx96-status-react-build-jsbundle-android'

[2019-08-06T06:52:41.626Z] error: cannot delete path '/nix/store/7b0v2rkvza6kgyjblvvs0bbjs4c9ws1r-status-react-build-jsbundle-android.drv' since it is still alive

[2019-08-06T06:52:41.626Z] make: *** [Makefile:158: jsbundle-android] Error 1

[2019-08-06T06:52:41.640Z] Checking for modifications in node_modules...

@pombeirp @jakubgs any clue?

@cammellos cammellos force-pushed the features/move-contacts branch from 4b8ead5 to b5639c4 Compare August 6, 2019 07:07
@asemiankevich
Copy link
Contributor

asemiankevich commented Aug 6, 2019

@cammellos seems profile and wallet do miss some property , so they are not shown correctly

image

image

ERROR [status-im.utils.async:19] - failed to run task Error: Missing value for property 'account.address'
2019-08-06 10:30:50.092 6680-6740/? E/unknown:ReactNative: console.error: "ERROR [status-im.utils.async:19] - failed to run task Error: Missing value for property 'account.address'", stack:
    error@345.js:96:29
    hca@7201:45
    a@7303:53
    c@91554:136
    b@91549:24
    <unknown>@33384:26
    <unknown>@33669:52
    Jb@11905:35
    fc@3075:47
    ne@5574:26
    CO@33627:11
    LNb@44290:16
    <unknown>@45416:135
    p@45373:32
    IT@43970:23
    <unknown>@43981:16
    <unknown>@43716:42
    lNb@43602:40
    _callTimer@112255:17
    _callImmediatesPass@112291:19
    callImmediates@112510:33
    callImmediates@-1
    __callImmediates@106756:35
    <unknown>@106577:34
    __guard@106739:15
    flushedQueue@106576:21
    flushedQueue@-1
    invokeCallbackAndReturnFlushedQueue@-1

@cammellos cammellos force-pushed the features/move-contacts branch from b5639c4 to fadcbb8 Compare August 6, 2019 08:32
@churik churik self-assigned this Aug 6, 2019
@asemiankevich
Copy link
Contributor

@cammellos i dont see any Push Notifications coming through , even i added 2 devices to contacts and setting is enabled. Could you please check that?

@cammellos
Copy link
Contributor Author

@asemiankevich sure, thanks for spotting the issue!

@statustestbot
Copy link

84% of end-end tests have passed

Total executed tests: 44
Failed tests: 7
Passed tests: 37

Failed tests (7)

Click to expand
1. test_public_chat_messaging

Device 1: Tap on SendMessageButton
Device 2: Looking for a message by text: 'hello'

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

Device sessions

2. test_add_to_contacts

Device 1: Tap on ChatMenuButton
Device 1: Tap on ViewProfileButton

Updated profile picture is not shown in one-to-one chat

Device sessions

3. test_can_add_existing_ens

Device 1: Looking for an element by text part: 'Username added'
Device 1: Looking for an element by text: 'Ok, got it'

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

Device sessions

4. test_messaging_in_different_networks

Device 1: Tap on SendMessageButton
Device 2: Looking for a message by text: 'test message'

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

Device sessions

5. test_switch_users_and_add_new_account

Device 1: Tap on ProfileButton
Device 1: Wait for ShareMyProfileButton

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

Device sessions

6. test_add_contact_from_public_chat

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

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

Device sessions

7. test_unread_messages_counter_public_chat

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

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

Device sessions

Passed tests (37)

Click to expand
1. test_block_user_from_public_chat
Device sessions

2. test_filters_from_daap
Device sessions

3. test_copy_and_paste_messages
Device sessions

4. test_send_transaction_from_daap
Device sessions

5. test_deploy_contract_from_daap
Device sessions

6. test_open_transaction_on_etherscan
Device sessions

7. test_long_press_to_delete_1_1_chat
Device sessions

8. test_password_in_logcat_sign_in
Device sessions

9. test_text_message_1_1_chat
Device sessions

10. test_sign_typed_message
Device sessions

11. test_unread_messages_counter_1_1_chat
Device sessions

12. test_logcat_send_transaction_from_daap
Device sessions

13. test_send_message_in_group_chat
Device sessions

14. test_logcat_send_transaction_from_wallet
Device sessions

15. test_send_token_with_7_decimals
Device sessions

16. test_offline_messaging_1_1_chat
Device sessions

17. test_modify_transaction_fee_values
Device sessions

18. test_send_eth_from_wallet_to_address
Device sessions

19. test_manage_assets
Device sessions

20. test_long_press_to_delete_public_chat
Device sessions

21. test_send_emoji
Device sessions

22. test_search_chat_on_home
Device sessions

23. test_logcat_recovering_account
Device sessions

24. test_logcat_sign_message_from_daap
Device sessions

25. test_send_stt_from_wallet
Device sessions

26. test_login_with_new_account
Device sessions

27. test_start_chat_with_ens
Device sessions

28. test_send_two_transactions_one_after_another_in_dapp
Device sessions

29. test_password_in_logcat_creating_account
Device sessions

30. test_backup_recovery_phrase
Device sessions

31. test_offline_status
Device sessions

32. test_open_google_com_via_open_dapp
Device sessions

33. test_sign_message_from_daap
Device sessions

34. test_user_can_remove_profile_picture
Device sessions

35. test_share_contact_code_and_wallet_address
Device sessions

36. test_refresh_button_browsing_app_webview
Device sessions

37. test_backup_recovery_phrase_warning_from_wallet
Device sessions

@statustestbot
Copy link

0% of end-end tests have passed

Total executed tests: 7
Failed tests: 7
Passed tests: 0

Failed tests (7)

Click to expand
1. test_public_chat_messaging

Device 1: Tap on SendMessageButton
Device 2: Looking for a message by text: 'hello'

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

Device sessions

2. test_add_to_contacts

Device 1: Tap on ChatMenuButton
Device 1: Tap on ViewProfileButton

Updated profile picture is not shown in one-to-one chat

Device sessions

3. test_can_add_existing_ens

Device 1: Looking for an element by text part: 'Username added'
Device 1: Looking for an element by text: 'Ok, got it'

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

Device sessions

4. test_messaging_in_different_networks

Device 1: Tap on SendMessageButton
Device 2: Looking for a message by text: 'test message'

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

Device sessions

5. test_switch_users_and_add_new_account

Device 1: Tap on ProfileButton
Device 1: Wait for ShareMyProfileButton

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

Device sessions

6. test_add_contact_from_public_chat

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

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

Device sessions

7. test_unread_messages_counter_public_chat

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

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

Device sessions

@churik
Copy link
Member

churik commented Aug 6, 2019

@cammellos

Issue 2: endless spinner when joining public chat after creating account

Steps:

  • create new account
  • join status channel

Logs\video here:

1. test_public_chat_messaging

Device 1: Tap on SendMessageButton
Device 2: Looking for a message by text: 'hello'

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

Device sessions

Not reproducible on nightly 06/08/2019.
Not reproducible after relogin.

@churik
Copy link
Member

churik commented Aug 6, 2019

Issue 3: userpicture is not updated in 1-1 and public chat

Found by e2e, see comment #8696 (comment), test test_add_to_contacts for logs and video

Steps:

  • user A: create a new account
  • user A: set custom photo
  • user B: create account
  • user B: add user A as contact
  • user B: send several messages to public chat
  • user A: start 1-1 chat with user B
  • user A: join the same public chat and check messages from user B

Expected result: can see custom photo of user B
Actual result: for user B default icon is shown

@cammellos cammellos force-pushed the features/move-contacts branch 2 times, most recently from dd37480 to 6597130 Compare August 6, 2019 14:20
@cammellos
Copy link
Contributor Author

@churik both issues should be fixed in the latest build, I haven't tested Push notifications as I need a real build with a real device, will do that, but in the meantime I think it's ready to be tested again (PN bug was due to issue 3 as well)

@asemiankevich
Copy link
Contributor

@cammellos what is the expected result in this case:

  1. user A blocks user B
  2. user B send some messages to user A -> user A does not see them
  3. user A unblocks user B
  4. user B sends more messages to user A

Which messages should see user A? The ones that were sent after unblock only? Or the whole chat (including the messages that were sent while user B was blocked )?

In this PR if i unblock user - > i see the messages before block, during block and after unblock - is this correct?

@statustestbot
Copy link

95% of end-end tests have passed

Total executed tests: 44
Failed tests: 2
Passed tests: 42

Failed tests (2)

Click to expand
1. test_can_add_existing_ens

Device 1: Looking for an element by text part: 'Username added'
Device 1: Looking for an element by text: 'Ok, got it'

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

Device sessions

2. test_switch_users_and_add_new_account

Device 1: Tap on ProfileButton
Device 1: Wait for ShareMyProfileButton

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

Device sessions

Passed tests (42)

Click to expand
1. test_block_user_from_public_chat
Device sessions

2. test_filters_from_daap
Device sessions

3. test_copy_and_paste_messages
Device sessions

4. test_send_transaction_from_daap
Device sessions

5. test_deploy_contract_from_daap
Device sessions

6. test_open_transaction_on_etherscan
Device sessions

7. test_public_chat_messaging
Device sessions

8. test_long_press_to_delete_1_1_chat
Device sessions

9. test_password_in_logcat_sign_in
Device sessions

10. test_text_message_1_1_chat
Device sessions

11. test_add_to_contacts
Device sessions

12. test_sign_typed_message
Device sessions

13. test_unread_messages_counter_1_1_chat
Device sessions

14. test_logcat_send_transaction_from_daap
Device sessions

15. test_send_message_in_group_chat
Device sessions

16. test_logcat_send_transaction_from_wallet
Device sessions

17. test_send_token_with_7_decimals
Device sessions

18. test_offline_messaging_1_1_chat
Device sessions

19. test_modify_transaction_fee_values
Device sessions

20. test_send_eth_from_wallet_to_address
Device sessions

21. test_manage_assets
Device sessions

22. test_long_press_to_delete_public_chat
Device sessions

23. test_send_emoji
Device sessions

24. test_search_chat_on_home
Device sessions

25. test_logcat_recovering_account
Device sessions

26. test_messaging_in_different_networks
Device sessions

27. test_logcat_sign_message_from_daap
Device sessions

28. test_send_stt_from_wallet
Device sessions

29. test_login_with_new_account
Device sessions

30. test_start_chat_with_ens
Device sessions

31. test_add_contact_from_public_chat
Device sessions

32. test_send_two_transactions_one_after_another_in_dapp
Device sessions

33. test_password_in_logcat_creating_account
Device sessions

34. test_backup_recovery_phrase
Device sessions

35. test_offline_status
Device sessions

36. test_open_google_com_via_open_dapp
Device sessions

37. test_unread_messages_counter_public_chat
Device sessions

38. test_sign_message_from_daap
Device sessions

39. test_user_can_remove_profile_picture
Device sessions

40. test_share_contact_code_and_wallet_address
Device sessions

41. test_refresh_button_browsing_app_webview
Device sessions

42. test_backup_recovery_phrase_warning_from_wallet
Device sessions

@cammellos
Copy link
Contributor Author

@asemiankevich I think there's an issue, will fix

@cammellos cammellos force-pushed the features/move-contacts branch from 6597130 to b1938e9 Compare August 7, 2019 08:37
@cammellos
Copy link
Contributor Author

@asemiankevich should be fixed in latest commit, i haven't had time to validate yet, but will do, but if you have some spare cycles and test it , it would be very helpful. thanks!

@asemiankevich
Copy link
Contributor

@asemiankevich should be fixed in latest commit, i haven't had time to validate yet, but will do, but if you have some spare cycles and test it , it would be very helpful. thanks!

sure :)

@asemiankevich
Copy link
Contributor

Checked:

  1. blocking user / unblocking + offline mode
  2. push notifications
  3. profile edit offline
  4. sending messages offline

all above looks okay-ish to me.

@churik
Copy link
Member

churik commented Aug 7, 2019

Tested:

ENS names in profile can't be checked due to #8707

e2e failures are not related to PR.

@cammellos cammellos force-pushed the features/move-contacts branch from b1938e9 to bdbfec6 Compare August 7, 2019 11:38
Contacts are now in status-go, no migration of contacts is provided so
all contacts will be lost upon installing this build.

I have left the initialization of filters a bit sketchy (we wait that
load-filters is called twice), as the next step will be to avoid calling
load-filters altogether, as now that both contacts & chats are in
status-go, there's no reason to call it from status-react, and can be
called directly from status-go on loading.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
@cammellos cammellos force-pushed the features/move-contacts branch from bdbfec6 to fe9d4e9 Compare August 7, 2019 11:40
@cammellos cammellos merged commit fe9d4e9 into develop Aug 7, 2019
@delete-merged-branch delete-merged-branch bot deleted the features/move-contacts branch August 7, 2019 11:40
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.

6 participants