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

Various fixes for Contact Request flows (2nd attempt) #15685

Merged
merged 2 commits into from
Apr 25, 2023

Conversation

ilmotta
Copy link
Contributor

@ilmotta ilmotta commented Apr 18, 2023

Fixes #15679

Summary

A quick and dirty PR that serves two purposes:

  • Make sure status-mobile works well with the upcoming status-go changes in PR Unifying the endpoints for contact flows status-go#3379.
  • Replace calls to wakuext_addContact with wakuext_sendContactRequest. This is what's been aligned with the desktop team, as we will go on to remove wakuext_addContact in the near future.

Note: Once this PR has been approved and tested by QAs, the status-go PR will be merged first, business as usual, and I'll update the status-go-version.json file to point to an actual status-go tag.

Out of scope

Refactoring; improvements in the existing code; UX.

Platforms

  • Android
  • iOS

Steps to test (for QAs)

Contact request flows may be impacted. The status-go PR status-im/status-go#3379 describes the changes being introduced, but perhaps for good measure all important CR flows should be double-checked in mobile.

status: ready

@ilmotta ilmotta added the bug label Apr 18, 2023
@ilmotta ilmotta self-assigned this Apr 18, 2023
@status-im-auto
Copy link
Member

status-im-auto commented Apr 18, 2023

Jenkins Builds

Click to see older builds (12)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ bba48e1 #1 2023-04-18 21:30:16 ~8 min tests 📄log
✔️ bba48e1 #1 2023-04-18 21:31:12 ~9 min android-e2e 🤖apk 📲
✔️ bba48e1 #1 2023-04-18 21:31:14 ~9 min android 🤖apk 📲
✔️ bba48e1 #1 2023-04-18 21:31:15 ~9 min ios 📱ipa 📲
✔️ 6fdfd48 #2 2023-04-19 11:59:59 ~5 min android 🤖apk 📲
✔️ 6fdfd48 #2 2023-04-19 12:00:36 ~6 min android-e2e 🤖apk 📲
✔️ 6fdfd48 #2 2023-04-19 12:00:47 ~6 min tests 📄log
✔️ 6fdfd48 #2 2023-04-19 12:00:59 ~6 min ios 📱ipa 📲
✔️ af6a59d #3 2023-04-21 10:37:56 ~8 min tests 📄log
✔️ af6a59d #3 2023-04-21 10:38:45 ~9 min ios 📱ipa 📲
✔️ af6a59d #3 2023-04-21 10:38:47 ~9 min android 🤖apk 📲
✔️ af6a59d #3 2023-04-21 10:38:47 ~9 min android-e2e 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 9ef84d1 #5 2023-04-24 17:45:02 ~8 min android 🤖apk 📲
✔️ 9ef84d1 #5 2023-04-24 17:45:19 ~8 min ios 📱ipa 📲
✔️ 9ef84d1 #5 2023-04-24 17:46:07 ~9 min tests 📄log
✔️ 9ef84d1 #5 2023-04-24 17:46:37 ~9 min android-e2e 🤖apk 📲
✔️ c6af945 #6 2023-04-25 15:35:16 ~6 min ios 📱ipa 📲
✔️ c6af945 #6 2023-04-25 15:35:47 ~6 min tests 📄log
✔️ c6af945 #6 2023-04-25 15:35:49 ~6 min android-e2e 🤖apk 📲
✔️ c6af945 #6 2023-04-25 15:35:49 ~6 min android 🤖apk 📲

src/status_im2/contexts/contacts/events.cljs Outdated Show resolved Hide resolved
@status-im-auto
Copy link
Member

93% of end-end tests have passed

Total executed tests: 29
Failed tests: 2
Passed tests: 27
IDs of failed tests: 702850,702838 

Failed tests (2)

Click to expand
  • Rerun failed tests

  • Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850

    Device 2: Tap on found: Button
    Device 2: Find `Text` by `xpath`: `//*[@content-desc="pending-contact-requests-count"]/android.widget.TextView`

    medium/test_activity_center.py:138: in test_activity_center_contact_request_decline
        if self.home_2.pending_contact_request_text.text != '1':
    ../views/base_element.py:391: in text
        text = self.find_element().text
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 2: Text by xpath: `//*[@content-desc="pending-contact-requests-count"]/android.widget.TextView` is not found on the screen 
    

    [[Blocked by 15500]]

    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_send_check_timestamps_sender_username, id: 702838

    Device 2: Verifying that 'hello' is under today
    Device 2: Looking for a message by text: hello

    critical/test_public_chat_browsing.py:418: in test_community_message_send_check_timestamps_sender_username
        channel.verify_message_is_under_today_text(message, self.errors)
    ../views/chat_view.py:923: in verify_message_is_under_today_text
        message_element.wait_for_visibility_of_element()
    ../views/base_element.py:135: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatElementByText by xpath:`//*[starts-with(@text,'hello')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element 
    

    [[blocked by 14797]]

    Device sessions

    Passed tests (27)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    2. test_1_1_chat_edit_message, id: 702855
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    5. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    6. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    7. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    8. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    9. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    3. test_navigation_jump_to, id: 702936
    Device sessions

    4. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    5. test_community_leave, id: 702845
    Device sessions

    6. test_community_unread_messages_badge, id: 702841
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_message_edit, id: 702843
    Device sessions

    @qoqobolo qoqobolo self-assigned this Apr 20, 2023
    @qoqobolo
    Copy link
    Contributor

    Hi @ilmotta, could you update the status-go-version.json file to resolve a conflict, please?

    @ilmotta
    Copy link
    Contributor Author

    ilmotta commented Apr 21, 2023

    Hi @ilmotta, could you update the status-go-version.json file to resolve a conflict, please?

    @qoqobolo, just rebased :) Thanks for reviewing this PR. I might be a bit slower today to reply, since I'm off.

    It's worth mentioning that in PRs like this one, where the dev has changed status-go-version.json on purpose to point to a specific revision, the conflict Github points out is sort of meaningless, because when rebasing, the dev will always replace whatever comes from develop with the hardcoded status-go revision anyway. Therefore, if it's the only file Github is saying has a conflict, it's safe to ignore it's recommendation to rebase. Edit: this paragraph is only true while the PR is under test by you or other QAs because after the QA approval the dev should obviously rebase against develop before merging anything.

    @qoqobolo
    Copy link
    Contributor

    It's worth mentioning that in PRs like this one, where the dev has changed status-go-version.json on purpose to point to a specific revision, the conflict Github points out is sort of meaningless, because when rebasing, the dev will always replace whatever comes from develop with the hardcoded status-go revision anyway. Therefore, if it's the only file Github is saying has a conflict, it's safe to ignore it's recommendation to rebase. Edit: this paragraph is only true while the PR is under test by you or other QAs because after the QA approval the dev should obviously rebase against develop before merging anything.

    Totally makes sense, thanks for the detailed explanation as always @ilmotta!

    Regarding the PR itself, found one issue so far that looks like a regression (testing is still in progress). Please take a look when you have time.

    ISSUE 1: 0x... key is displayed instead of a display name in the toast when your CR is accepted

    Steps to reproduce:

    1. UserA: send CR to UserB
    2. UserB: accept CR
    3. UserA: pay attention to the toast [Username] accepted your contact request

    Expected result: the user's display name is shown in place of [Username]
    Actual result: the key is shown instead

    Screenshot 2023-04-21 at 16 46 11


    Also, I have a question.
    In the status-go PR description I see two following points:

    Screenshot 2023-04-21 at 17 38 05

    However, on the mobile side, it currently doesn't work like that:

    1. Chat only automatically appears on the CR sender's side
    2. The default CR message is still displayed at the top of the history for both users (screenshot below)

    Screenshot 2023-04-21 at 17 29 23

    Is it expected for now for mobile? Let me know, if we need to summon MishkaRogachev to clarify this.

    @MishkaRogachev
    Copy link

    @qoqobolo thanks for testing!

    1. We have quite similar issue. But i suspect this is desktop application side issue. Contact details are null only for pending outgoing notification, other states work well.
    2. Chat should appear for both sides, i've updated tests to ensure this working

    @ilmotta
    Copy link
    Contributor Author

    ilmotta commented Apr 24, 2023

    ISSUE 1: 0x... key is displayed instead of a display name in the toast when your CR is accepted

    @qoqobolo, I swear I've seen ISSUE 1 happen in other branches a couple times, since I wasn't surprised when I read you reported ISSUE 1. I tried to reproduce now in develop, but I couldn't. Maybe my memory is playing tricks with me.

    The default CR message is still displayed at the top of the history for both users (screenshot below)

    I wouldn't know that without further investigation @qoqobolo. Tbh I don't know what's the expected behavior either.

    @qoqobolo
    Copy link
    Contributor

    Okay, now we have three points that need clarification/rechecking.

    1. ISSUE 1

    I swear I've seen ISSUE 1 happen in other branches a couple times, since I wasn't surprised when I read you reported ISSUE 1. I tried to reproduce now in develop, but I couldn't. Maybe my memory is playing tricks with me.

    Hmm, never seen this before the current PR. Asked other QAs, and they didn't see that either.
    There used to be a bug where the toast displayed a 3-random name instead of a display name, that's the closest thing that comes to my mind.
    @ilmotta can you check if this issue can be fixed here, please? Or I can log this separately as a follow-up after this PR is merged.
    WDYT?


    And two mismatches between the behavior in current PR and the status-go PR:

    2. Chat appears for both users after becoming mutual contacts

    @MishkaRogachev just fixed this issue in the status-go PR. @ilmotta could you update this PR so I can test the fix on our side, please?

    3. No default CR message in chat should appear (currently, the default CR message is still displayed at the top of the history for both users on mobile)

    @cammellos could you help us define what is the expected behavior for mobile right now?
    Should these go changes be applied to mobile in the current PR as well? Or we can add this behavior later (in which case I will file the issue separately).


    Other than that, I didn't find any other issues, the PR looks good.

    @cammellos
    Copy link
    Contributor

    @qoqobolo 3 can be addressed separately, we can clarify the behavior with the UX team.

    2 should be addressed here, since @MishkaRogachev already made the changes I believe

    1 probably we want to understand why it happens if we are to merge and just figure out if it's due to this PR or no

    @qoqobolo
    Copy link
    Contributor

    Thank you @cammellos

    @cammellos
    Copy link
    Contributor

    @ilmotta @MishkaRogachev regarding 1) I believe the code is using Name property in notification.

    This is probably ok for toasts, since they are very ephemeral, but not ok for permanent notifications, as the name change (not sure whether we use it or not actually, but worth checking).

    But this indicates that Name on a notification is probably the chat id, which is not what we want in most cases, @MishkaRogachev could you check in status-go with a test if that's the case?

    Thank you

    @MishkaRogachev
    Copy link

    MishkaRogachev commented Apr 24, 2023

    @ilmotta @MishkaRogachev regarding 1) I believe the code is using Name property in notification.

    This is probably ok for toasts, since they are very ephemeral, but not ok for permanent notifications, as the name change (not sure whether we use it or not actually, but worth checking).

    But this indicates that Name on a notification is probably the chat id, which is not what we want in most cases, @MishkaRogachev could you check in status-go with a test if that's the case?

    Thank you

    Sure, i will check that notification's name matches contact.PrimaryName() for all notifications related with contact requests

    @ilmotta
    Copy link
    Contributor Author

    ilmotta commented Apr 24, 2023

    Hmm, never seen this before the current PR. Asked other QAs, and they didn't see that either.

    You're right @qoqobolo, maybe it was really just my mind playing tricks, or probably I've seen this issue while creating this PR and thought it existed in develop as well.

    @MishkaRogachev and @qoqobolo, I've updated this PR to point to the latest revision from the status-go PR and tested on two devices. It seems ISSUE 1 is indeed fixed. I haven't tested the other issues though.

    Thanks @cammellos for helping us understand what to do.

    @MishkaRogachev
    Copy link

    Hmm, never seen this before the current PR. Asked other QAs, and they didn't see that either.

    I suppose there can be more similar cases, when we expect GetActivityCenterNotificationByID will return notification with valid name. But we don't store name in the database. I don't have strong opinion on this subject because we don't use Name property of notification on the desktop

    @status-im-auto
    Copy link
    Member

    93% of end-end tests have passed

    Total executed tests: 29
    Failed tests: 2
    Passed tests: 27
    
    IDs of failed tests: 702838,702850 
    

    Failed tests (2)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_send_check_timestamps_sender_username, id: 702838

    Device 2: Verifying that 'hello' is under today
    Device 2: Looking for a message by text: hello

    critical/test_public_chat_browsing.py:418: in test_community_message_send_check_timestamps_sender_username
        channel.verify_message_is_under_today_text(message, self.errors)
    ../views/chat_view.py:923: in verify_message_is_under_today_text
        message_element.wait_for_visibility_of_element()
    ../views/base_element.py:135: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatElementByText by xpath:`//*[starts-with(@text,'hello')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element 
    

    [[blocked by 14797]]

    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850

    Device 2: Tap on found: Button
    Device 2: Find Text by xpath: //*[@content-desc="pending-contact-requests-count"]/android.widget.TextView

    medium/test_activity_center.py:138: in test_activity_center_contact_request_decline
        if self.home_2.pending_contact_request_text.text != '1':
    ../views/base_element.py:391: in text
        text = self.find_element().text
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 2: Text by xpath: `//*[@content-desc="pending-contact-requests-count"]/android.widget.TextView` is not found on the screen 
    

    [[Blocked by 15500]]

    Device sessions

    Passed tests (27)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    3. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    4. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    5. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    6. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    7. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    8. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    9. test_1_1_chat_edit_message, id: 702855
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    3. test_navigation_jump_to, id: 702936
    Device sessions

    4. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_offline_pn, id: 702808
    Device sessions

    3. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_mentions_push_notification, id: 702786
    Device sessions

    2. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    3. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    4. test_community_leave, id: 702845
    Device sessions

    5. test_community_message_edit, id: 702843
    Device sessions

    6. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    @qoqobolo
    Copy link
    Contributor

    Confirming that Issue 1 is fixed and chats appear on both sides now.
    No other issues were found.
    Thanks everyone for your awesome work @ilmotta @MishkaRogachev @cammellos!
    PR can be merged.

    @ilmotta ilmotta merged commit 30f0b43 into develop Apr 25, 2023
    @ilmotta ilmotta deleted the fix/contact-request-issues branch April 25, 2023 16:32
    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.

    Contact Request issues
    8 participants