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

Communities: Share Selective Account #18382

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

ajayesivan
Copy link
Contributor

@ajayesivan ajayesivan commented Jan 4, 2024

fixes #18010

This PR enables selectively sharing addresses when joining a community.

Screen Recording:

Selectively.Share.Accounts.mp4

Test Note

This feature is currently under a flag not enabled in the development branch, so these changes do not require manual QA.

:key-fn :address
:data accounts}]
(when (empty? @selected-addresses)
[rn/view
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please ignore the inaccurate colors, this is a temporary implementation. I will replace this with drawer/bottom-actions component after updating that component.

#15006

@ajayesivan ajayesivan self-assigned this Jan 4, 2024
@ajayesivan ajayesivan force-pushed the 18010-share-selective-account branch from ac18484 to 9a01883 Compare January 4, 2024 02:56
@status-im-auto
Copy link
Member

status-im-auto commented Jan 4, 2024

Jenkins Builds

Click to see older builds (9)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ ac18484 #1 2024-01-04 02:56:23 ~5 min tests 📄log
✔️ 9a01883 #2 2024-01-04 03:00:57 ~4 min tests 📄log
✔️ 9a01883 #2 2024-01-04 03:02:39 ~6 min ios 📱ipa 📲
✔️ 9a01883 #2 2024-01-04 03:03:18 ~6 min android 🤖apk 📲
✔️ 9a01883 #2 2024-01-04 03:04:04 ~7 min android-e2e 🤖apk 📲
✔️ 46b8572 #3 2024-01-04 09:59:52 ~5 min tests 📄log
✔️ 46b8572 #3 2024-01-04 10:01:10 ~6 min ios 📱ipa 📲
✔️ 46b8572 #3 2024-01-04 10:03:18 ~8 min android-e2e 🤖apk 📲
✔️ 46b8572 #3 2024-01-04 10:03:31 ~8 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4e93be5 #4 2024-01-05 06:34:19 ~5 min tests 📄log
✔️ 4e93be5 #4 2024-01-05 06:34:51 ~5 min ios 📱ipa 📲
✔️ 4e93be5 #4 2024-01-05 06:37:51 ~8 min android-e2e 🤖apk 📲
✔️ 4e93be5 #4 2024-01-05 06:37:56 ~8 min android 🤖apk 📲
✔️ 7936159 #5 2024-01-05 13:27:26 ~4 min tests 📄log
✔️ 7936159 #5 2024-01-05 13:27:51 ~5 min ios 📱ipa 📲
✔️ 7936159 #5 2024-01-05 13:31:17 ~8 min android-e2e 🤖apk 📲
✔️ 7936159 #5 2024-01-05 13:31:18 ~8 min android 🤖apk 📲

@ajayesivan ajayesivan force-pushed the 18010-share-selective-account branch from 9a01883 to 46b8572 Compare January 4, 2024 09:54
Comment on lines +188 to +190
(rf/reg-event-fx :communities/set-addresses-for-permissions
(fn [{:keys [db]} [addresses]]
{:db (assoc-in db [:communities/addresses-for-permissions] addresses)}))
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this was discussed in prev meetings. From what I understand, each community typically manages its own :communities/addresses-for-permissions.

I was thinking, might it be more streamlined to tie the community ID directly to the permissions? We could do something like this:

(assoc-in db [:communities/addresses-for-permissions community-id] addresses)

Or assoc this into existing community?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We haven't discussed this yet. Currently, I'm using :communities/addresses-for-permissions solely to store the selected addresses for the community we're attempting to join. Each time we open the request-to-join page, it updates the key with all addresses, allowing users to modify their selection. At the moment, I'm only utilizing it for the request-to-join UI.

Your suggestion to tie or link it with community data makes sense. However, I'm uncertain if we'll receive shared addresses from status-go once we join a community. If that's possible, keeping that information in the database tied to the community would be more reliable. I'll check if status-go shares this information. Please let me know if you have any insights on this.

Feel free to correct me if my thought process seems incorrect.

Copy link
Contributor

Choose a reason for hiding this comment

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

Checked the UI again. I'm fine with this solution.

@status-im-auto
Copy link
Member

48% of end-end tests have passed

Total executed tests: 48
Failed tests: 23
Expected to fail tests: 2
Passed tests: 23
IDs of failed tests: 702809,702782,703194,702859,702957,702840,703086,702948,702894,702745,704615,703202,702786,702839,702838,702844,702843,702731,702730,702845,702958,703629,702841 
IDs of expected to fail tests: 703503,702808 

Failed tests (23)

Click to expand
  • Rerun failed tests

  • Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_reactions, id: 703202

    Device 3: Wait for text element `EmojisNumber` to be equal to `1`
    Device 3: Find `EmojisNumber` by `xpath`: `//*[starts-with(@text,'This is a test message to check some reactions.')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']/../..//*[@content-desc='emoji-reaction-1']/android.widget.TextView`

    critical/chats/test_group_chat.py:120: in test_group_chat_reactions
        message_element.emojis_below_message(emoji="love").wait_for_element_text(1)
    ../views/base_element.py:173: in wait_for_element_text
        element_text = self.find_element().text.strip()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 3: EmojisNumber by xpath: `//*[starts-with(@text,'This is a test message to check some reactions.')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']/../..//*[@content-desc='emoji-reaction-1']/android.widget.TextView` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/c/')]
    Device 2: Wait for element Button for max 120s and click when it is available

    Test setup failed: activity_center/test_activity_center.py:409: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958

    Test setup failed: activity_center/test_activity_center.py:409: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809

    Test setup failed: critical/chats/test_public_chat_browsing.py:835: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    2. test_community_hashtag_links_to_community_channels, id: 702948

    Test setup failed: critical/chats/test_public_chat_browsing.py:835: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element 
    

    [[Can't navigate to a channel by hashtag link, https://github.com//issues/18095]]

    3. test_community_mentions_push_notification, id: 702786

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/c/')]
    Device 2: Wait for element Button for max 120s and click when it is available

    Test setup failed: critical/chats/test_public_chat_browsing.py:835: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    4. test_community_leave, id: 702845

    Test setup failed: critical/chats/test_public_chat_browsing.py:835: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    5. test_community_join_when_node_owner_offline, id: 703629

    Test setup failed: critical/chats/test_public_chat_browsing.py:835: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element 
    

    [[Can't join a community if admin goes offline, https://github.com//issues/17678]]

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782

    Device 2: Find OpenInStatusButton by xpath: //*[@text="Open in Status"]
    Device 2: Tap on found: OpenInStatusButton

    critical/chats/test_1_1_public_chats.py:175: in test_1_1_chat_emoji_send_reply_and_open_link
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     No reply received in 1-1 chat
    E    Reply for 'Test with link: https://status.im/ here should be nothing unusual.' not present in message received in public chat
    



    Device sessions

    2. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 1: Tap on found: Button
    Device 1: Find ProfilePictureElement by accessibility id: chat-icon

    critical/chats/test_1_1_public_chats.py:270: in test_1_1_chat_non_latin_messages_stack_update_profile_photo
        self.profile_1.edit_profile_picture(image_index=2)
    ../views/profile_view.py:443: in edit_profile_picture
        self.profile_picture.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: ProfilePictureElement by accessibility id: `chat-icon` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    3. test_1_1_chat_pin_messages, id: 702731

    Device 1: Find Text by xpath: //*[starts-with(@text,'Message 3')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView
    Device 1: Text is Sent

    critical/chats/test_1_1_public_chats.py:219: in test_1_1_chat_pin_messages
        self.chat_1.chat_element_by_text(message).wait_for_status_to_be("Delivered")
    ../views/chat_view.py:243: in wait_for_status_to_be
        raise TimeoutException("Message status was not changed to %s, it's %s" % (expected_status, current_status))
     Message status was not changed to Delivered, it's Sent
    



    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730

    Device 2: Wait for text element EmojisNumber to be equal to 1
    Device 2: Find EmojisNumber by xpath: //*[starts-with(@text,'Message sender')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']/../..//*[@content-desc='emoji-reaction-2']/android.widget.TextView

    critical/chats/test_1_1_public_chats.py:63: in test_1_1_chat_message_reaction
        message_receiver.emojis_below_message(emoji="thumbs-up").wait_for_element_text(1, 90)
    ../views/base_element.py:173: in wait_for_element_text
        element_text = self.find_element().text.strip()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: EmojisNumber by xpath: `//*[starts-with(@text,'Message sender')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']/../..//*[@content-desc='emoji-reaction-2']/android.widget.TextView` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    2. test_community_one_image_send_reply, id: 702859

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    3. test_community_emoji_send_copy_paste_reply, id: 702840

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    4. test_community_mark_all_messages_as_read, id: 703086

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    5. test_community_contact_block_unblock_offline, id: 702894

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element 
    

    [[Message can be missed after unblock: https://github.com//issues/16873]]

    6. test_community_edit_delete_message_when_offline, id: 704615

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    7. test_community_message_delete, id: 702839

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    8. test_community_message_send_check_timestamps_sender_username, id: 702838

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='chat-item']//android.widget.TextView[contains(@text,'https://status.app/c/')]
    Device 2: Wait for element Button for max 120s and click when it is available

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    9. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    10. test_community_message_edit, id: 702843

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    11. test_community_unread_messages_badge, id: 702841

    Test setup failed: critical/chats/test_public_chat_browsing.py:319: in prepare_devices
        self.community_2.join_community()
    ../views/chat_view.py:428: in join_community
        self.join_button.wait_and_click(120)
    ../views/base_element.py:96: in wait_and_click
        self.wait_for_visibility_of_element(sec)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`show-request-to-join-screen-button` is not found on the screen after wait_for_visibility_of_element
    



    Expected to fail tests (2)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:324: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline 
    

    [[Data delivery issue]]

    Device sessions

    Passed tests (23)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_mute_chat, id: 703495
    Device sessions

    3. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    4. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_add_contact_field_validation, id: 702777
    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    3. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    2. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    3. test_1_1_chat_edit_message, id: 702855
    Device sessions

    4. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    3. test_community_undo_delete_message, id: 702869
    Device sessions

    4. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    @ajayesivan ajayesivan force-pushed the 18010-share-selective-account branch from 46b8572 to 4e93be5 Compare January 5, 2024 06:28
    Copy link
    Contributor

    @ilmotta ilmotta left a comment

    Choose a reason for hiding this comment

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

    Hey @ajayesivan, PR looks good to me except for the way the selected addresses are being handled with local Reagent atoms mixed with re-frame. We can refactor in a separate PR if you prefer.

    Feature is starting to look nice!

    Interestingly, with the toggle enabled, it's possible to reproduce exactly the issue reported here #18308. The user is limited to join a community with the Ethereum account only. I'm already assigned to the bug issue as you remember.

    selected-accounts (filter #(contains? addresses-for-permissions
    (:address %))
    accounts)]
    (rn/use-effect (fn []
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    You could avoid use-effect and just call [rf/dispatch [:communities/set-addresses-for-permissions ...] in the external function of a form-2 component. Apparently, if we do move in the direction of UIx or just plain React, everything will be "functional" components (in Reagent's terminology). Because of that I don't feel strong in any way about not using use-effect here.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    @ilmotta, If I'm not mistaken, with form-2 I will also have to move accounts subscription to the outer function.

    (defn view
      []
      (let [accounts (rf/sub [:wallet/accounts-with-customization-color])]
        (rf/dispatch [:communities/set-addresses-for-permissions
                      (set (map :address accounts))])
        (fn []
          (let [{id :community-id}          (rf/sub [:get-screen-params])
                {:keys [name color images]} (rf/sub [:communities/community id])

    This looks a bit more complicated to me compared to the use-effect approach.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Fair enough :) It would be more about the performance advantage because functional components in Reagent are slower. Thanks, it's fine to keep the code as is.

    accounts (rf/sub [:wallet/accounts-with-customization-color])]
    [rn/safe-area-view {:style style/container}
    accounts (rf/sub [:wallet/accounts-with-customization-color])
    selected-addresses (reagent/atom (rf/sub [:communities/addresses-for-permissions]))]
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    It's a smell that we are wrapping rf/sub in a Reagent atom. It's the first time I've seen this.

    The whole address selection state during a request to join is global, there's never a competing screen where the user is doing the same thing, hence there's no need to mix Reagent atoms with re-frame, this brings more complexity. Only re-frame would suffice, and account-item would just dispatch the necessary events to toggle the respective address, not swap a temporary Reagent atom.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Sure, I'll address this in a follow-up PR. I will also try to add unit tests along with it.

    I couldn't find a similar implementation anywhere 😅. My rationale was that since the selected state is only used in this screen, it seemed more fitting to keep it local.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    No worries @ajayesivan I understand there's room for interpretation about when to use re-frame, and when not to use it. In my experience so far, it's easier to keep the UI simple & boring if we use re-frame as much as we can.

    I think we can all agree that, in general (not always), it's a joy to work on UI code where there are no local state and only dispatches and subscriptions. Reagent atoms are definitely important, but should be used IMO only when strictly necessary, not the other way around. We lose so much when we move out of re-frame, e.g. harder to debug local state, less observability (no logs, no re-frisk), harder to unit test since the UI dictates more things, harder to write our integration tests because events require more arguments to be passed around, etc.

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

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

    Follow-up issue: #18405

    Copy link
    Member

    Choose a reason for hiding this comment

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

    Hi, Thank you @ajay for linking to the discussion.

    Wrapping a subscription inside a reagent atom seems wrong also to me. But making changes globally also doesn't look nice for the screen which has a confirm button. This causes weird scenarios/bugs like mentioned here in PR description: #18759

    :disabled? (empty? @selected-addresses)
    :on-press (fn []
    (rf/dispatch [:communities/set-addresses-for-permissions
    @selected-addresses])
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Similar here, the selected addresses state should be in the app db, so there would be no need to pass it around when dispatching events. Moving the state to the app db would also allow us to cover more of the logic with unit tests for event handlers.

    @status-im-auto
    Copy link
    Member

    65% of end-end tests have passed

    Total executed tests: 48
    Failed tests: 13
    Expected to fail tests: 4
    Passed tests: 31
    
    IDs of failed tests: 702733,702777,702957,702851,702840,702948,702742,702869,702855,703391,702846,702958,703382 
    
    IDs of expected to fail tests: 702894,703503,702808,703629 
    

    Failed tests (13)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742

    Device 1: ChatMessageInput element not found
    Device 1: Sending message 'mmmeowesage_text'

    critical/chats/test_public_chat_browsing.py:94: in test_community_copy_and_paste_message_in_chat_input
        self.channel.send_message(message)
    ../views/chat_view.py:1004: in send_message
        self.chat_message_input.wait_for_element(wait_chat_input_sec)
    ../views/base_element.py:121: in wait_for_element
        raise TimeoutException(
     Device `1`: `ChatMessageInput` by` accessibility id`: `chat-message-input` is not found on the screen after wait_for_element
    



    Device sessions

    2. test_community_undo_delete_message, id: 702869

    Device 1: ChatMessageInput element not found
    Device 1: Sending message 'message to delete and undo'

    critical/chats/test_public_chat_browsing.py:109: in test_community_undo_delete_message
        self.channel.send_message(message_to_delete)
    ../views/chat_view.py:1004: in send_message
        self.chat_message_input.wait_for_element(wait_chat_input_sec)
    ../views/base_element.py:121: in wait_for_element
        raise TimeoutException(
     Device `1`: `ChatMessageInput` by` accessibility id`: `chat-message-input` is not found on the screen after wait_for_element
    



    Device sessions

    3. test_community_navigate_to_channel_when_relaunch, id: 702846

    Device 1: Click until ChatMessageInput by accessibility id: chat-message-input will be presented
    Device 1: Sending message 'some_text'

    critical/chats/test_public_chat_browsing.py:80: in test_community_navigate_to_channel_when_relaunch
        self.channel.send_message(text_message)
    ../views/chat_view.py:1004: in send_message
        self.chat_message_input.wait_for_element(wait_chat_input_sec)
    ../views/base_element.py:121: in wait_for_element
        raise TimeoutException(
     Device `1`: `ChatMessageInput` by` accessibility id`: `chat-message-input` is not found on the screen after wait_for_element
    



    Device sessions

    4. test_community_mute_community_and_channel, id: 703382

    Device 1: Getting cats channel element in community
    Device 1: Looking for chat: 'cats'

    critical/chats/test_public_chat_browsing.py:143: in test_community_mute_community_and_channel
        self.community_view.get_channel(self.channel_name).long_press_element()
    ../views/base_element.py:312: in long_press_element
        element = self.find_element()
    ../views/home_view.py:74: in find_element
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatElement by xpath:`//*[@content-desc='channel-list-item']//*[starts-with(@text,'# cats')]/..` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840

    Device 2: Type test message to ChatMessageInput
    Device 2: Find SendMessageButton by accessibility id: send-message-button

    critical/chats/test_public_chat_browsing.py:520: in test_community_emoji_send_copy_paste_reply
        self.channel_2.send_message_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: SendMessageButton by accessibility id: `send-message-button` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957

    Device 2: Tap on found: Button
    Device 2: Attempt 0 is successful clicking //[contains(@text, 'user1')]/ancestor::[@content-desc='activity']/*[@content-desc="accept-contact-request"]

    Test setup failed: activity_center/test_activity_center.py:393: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:394: in handle_contact_request
        self.close_activity_centre.wait_for_rendering_ended_and_click()
    ../views/base_element.py:155: in wait_for_rendering_ended_and_click
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`close-activity-center` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958

    Test setup failed: activity_center/test_activity_center.py:393: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:394: in handle_contact_request
        self.close_activity_centre.wait_for_rendering_ended_and_click()
    ../views/base_element.py:155: in wait_for_rendering_ended_and_click
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by accessibility id:`close-activity-center` is not found on the screen after wait_for_visibility_of_element
    



    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    Device 2: Tap on found: Button
    Device 1: Getting PN by 'DELETE ME'

    critical/chats/test_1_1_public_chats.py:515: in test_1_1_chat_text_message_delete_push_disappear
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message status was not changed to 'Delivered' after 60 s
    



    Device sessions

    2. test_1_1_chat_edit_message, id: 702855

    Device 2: Tap on found: Text
    Device 2: Find Text by xpath: //*[starts-with(@text,'Message before edit 1-1')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView

    critical/chats/test_1_1_public_chats.py:378: in test_1_1_chat_edit_message
        self.chat_2.chat_element_by_text(message_before_edit_1_1).wait_for_status_to_be("Delivered")
    ../views/chat_view.py:243: in wait_for_status_to_be
        raise TimeoutException("Message status was not changed to %s, it's %s" % (expected_status, current_status))
     Message status was not changed to Delivered, it's
    



    Device sessions

    3. test_1_1_chat_send_image_save_and_share, id: 703391

    Device 2: Find Button by accessibility id: image-0
    Device 2: Click system back button

    critical/chats/test_1_1_public_chats.py:453: in test_1_1_chat_send_image_save_and_share
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message about saving a photo is not shown for sender.
    



    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_hashtag_links_to_community_channels, id: 702948

    Device 1: Click until ChatMessageInput by accessibility id: chat-message-input will be presented
    Device 1: Sending message 'this message should be visible to the user before joining'

    critical/chats/test_public_chat_browsing.py:1005: in test_community_hashtag_links_to_community_channels
        self.channel_1.send_message(control_message_general_chat)
    ../views/chat_view.py:1004: in send_message
        self.chat_message_input.wait_for_element(wait_chat_input_sec)
    ../views/base_element.py:121: in wait_for_element
        raise TimeoutException(
     Device `1`: `ChatMessageInput` by` accessibility id`: `chat-message-input` is not found on the screen after wait_for_element
    



    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_add_contact_field_validation, id: 702777

    Device 2: Tap on found: LogInButton
    Device 2: Find Button by xpath: //*[@text="Copy code"]

    activity_center/test_activity_center.py:210: in test_add_contact_field_validation
        sync_code = self.profile_2.get_sync_code()
    ../views/profile_view.py:544: in get_sync_code
        self.element_by_translation_id("copy-qr").click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: Button by xpath: `//*[@text="Copy code"]` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851

    Device 1: Tap on found: Button
    # STEP: Device1 check that contact appeared in contact list mutually

    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:703: in urlopen
        httplib_response = self._make_request(
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:449: in _make_request
        six.raise_from(e, None)
    <string>:3: in raise_from
        ???
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:444: in _make_request
        httplib_response = conn.getresponse()
    /usr/lib/python3.10/http/client.py:1375: in getresponse
        response.begin()
    /usr/lib/python3.10/http/client.py:318: in begin
        version, status, reason = self._read_status()
    /usr/lib/python3.10/http/client.py:287: in _read_status
        raise RemoteDisconnected("Remote end closed connection without"
    E   http.client.RemoteDisconnected: Remote end closed connection without response
    
    During handling of the above exception, another exception occurred:
    activity_center/test_activity_center.py:133: in test_activity_center_contact_request_accept_swipe_mark_all_as_read
        self.device_2.just_fyi('Device1 check that contact appeared in contact list mutually')
    ../views/base_view.py:394: in just_fyi
        self.driver.execute_script("sauce:context=STEP: %s" % some_str)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:405: in execute_script
        return self.execute(command, {"script": script, "args": converted_args})["value"]
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:343: in execute
        response = self.command_executor.execute(driver_command, params)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py:291: in execute
        return self._request(command_info[0], url, body=data)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/remote_connection.py:312: in _request
        response = self._conn.request(method, url, body=body, headers=headers)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/request.py:78: in request
        return self.request_encode_body(
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/request.py:170: in request_encode_body
        return self.urlopen(method, url, **extra_kw)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/poolmanager.py:376: in urlopen
        response = conn.urlopen(method, u.request_uri, **kw)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:787: in urlopen
        retries = retries.increment(
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/util/retry.py:550: in increment
        raise six.reraise(type(error), error, _stacktrace)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/packages/six.py:769: in reraise
        raise value.with_traceback(tb)
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:703: in urlopen
        httplib_response = self._make_request(
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:449: in _make_request
        six.raise_from(e, None)
    <string>:3: in raise_from
        ???
    /home/jenkins/.local/lib/python3.10/site-packages/urllib3/connectionpool.py:444: in _make_request
        httplib_response = conn.getresponse()
    /usr/lib/python3.10/http/client.py:1375: in getresponse
        response.begin()
    /usr/lib/python3.10/http/client.py:318: in begin
        version, status, reason = self._read_status()
    /usr/lib/python3.10/http/client.py:287: in _read_status
        raise RemoteDisconnected("Remote end closed connection without"
     ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
    



    Device sessions

    Expected to fail tests (4)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_join_when_node_owner_offline, id: 703629

    Device 1: Tap on found: Text
    Device 1: Find Text by xpath: //*[starts-with(@text,'this message should be visible to the user before joining')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView

    critical/chats/test_public_chat_browsing.py:1109: in test_community_join_when_node_owner_offline
        self.channel_1.chat_element_by_text(control_message_general_chat).wait_for_status_to_be(
    ../views/chat_view.py:239: in wait_for_status_to_be
        current_status = self.status
    ../views/chat_view.py:227: in status
        status = status_element.text
    ../views/base_element.py:407: in text
        text = self.find_element().text
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Text by xpath: `//*[starts-with(@text,'this message should be visible to the user before joining')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception 
    

    [[Can't join a community if admin goes offline, https://github.com//issues/17678]]

    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_contact_block_unblock_offline, id: 702894

    Device 2: Tap on found: Text
    Device 2: Find Text by xpath: //*[starts-with(@text,'Hurray! unblocked')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView

    critical/chats/test_public_chat_browsing.py:735: in test_community_contact_block_unblock_offline
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message was not delivered after back up online. 
    

    [[Message can be missed after unblock: https://github.com//issues/16873]]

    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:324: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline 
    

    [[Data delivery issue]]

    Device sessions

    Passed tests (31)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_one_image_send_reply, id: 702859
    Device sessions

    3. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    4. test_community_edit_delete_message_when_offline, id: 704615
    Device sessions

    5. test_community_message_delete, id: 702839
    Device sessions

    6. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    7. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    8. test_community_message_edit, id: 702843
    Device sessions

    9. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_mute_chat, id: 703495
    Device sessions

    3. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    4. test_group_chat_reactions, id: 703202
    Device sessions

    5. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    5. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_mentions_push_notification, id: 702786
    Device sessions

    3. test_community_leave, id: 702845
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    @ajayesivan ajayesivan force-pushed the 18010-share-selective-account branch from 4e93be5 to 7936159 Compare January 5, 2024 13:22
    @ajayesivan ajayesivan merged commit 4edb14b into develop Jan 5, 2024
    6 checks passed
    @ajayesivan ajayesivan deleted the 18010-share-selective-account branch January 5, 2024 13:34
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Communities: Share Selective Account
    5 participants