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

Don't parse unused identicon in android pn #17174

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

cammellos
Copy link
Contributor

Removes parsing of identicon from notification, which won't be showing it anymore (it's a bit more complicated to add the actual image, so removing for now).

I am trying to set up unit tests for this part, but getting into some issues, as this is a blocker, I will send the PR for review now

Fixes: #17160


String name = bundle.getString("name");
Copy link
Contributor

Choose a reason for hiding this comment

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

looks good! tiny nitpick on placing a TODO comment or link to issue here :)

@status-im-auto
Copy link
Member

status-im-auto commented Sep 4, 2023

Jenkins Builds

Click to see older builds (18)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ cd0a62b #1 2023-09-04 11:20:09 ~5 min android 🤖apk 📲
✔️ cd0a62b #1 2023-09-04 11:21:40 ~7 min ios 📱ipa 📲
✔️ cd0a62b #1 2023-09-04 11:22:03 ~7 min android-e2e 🤖apk 📲
✔️ cd0a62b #1 2023-09-04 11:23:52 ~9 min tests 📄log
✔️ de65700 #2 2023-09-04 18:05:08 ~6 min android-e2e 🤖apk 📲
✔️ de65700 #2 2023-09-04 18:06:56 ~8 min ios 📱ipa 📲
✔️ de65700 #2 2023-09-04 18:08:48 ~10 min android 🤖apk 📲
de65700 #2 2023-09-04 18:11:31 ~12 min tests 📄log
✔️ 4f2714b #3 2023-09-04 19:14:59 ~5 min android-e2e 🤖apk 📲
✔️ 4f2714b #3 2023-09-04 19:17:49 ~8 min android 🤖apk 📲
✔️ 4f2714b #3 2023-09-04 19:28:26 ~19 min ios 📱ipa 📲
✔️ e6e3d9a #4 2023-09-04 19:44:39 ~5 min android-e2e 🤖apk 📲
✔️ e6e3d9a #4 2023-09-04 19:48:07 ~8 min android 🤖apk 📲
✔️ e6e3d9a #4 2023-09-04 19:49:01 ~9 min ios 📱ipa 📲
✔️ 78f1207 #5 2023-09-05 09:14:37 ~5 min android 🤖apk 📲
✔️ 78f1207 #5 2023-09-05 09:17:54 ~8 min android-e2e 🤖apk 📲
✔️ 78f1207 #5 2023-09-05 09:18:55 ~9 min ios 📱ipa 📲
✔️ 78f1207 #5 2023-09-05 09:23:34 ~14 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a948335 #6 2023-09-05 09:59:00 ~5 min android-e2e 🤖apk 📲
✔️ a948335 #6 2023-09-05 10:00:08 ~6 min ios 📱ipa 📲
✔️ a948335 #6 2023-09-05 10:02:14 ~9 min android 🤖apk 📲
✔️ 9b4ea2b #7 2023-09-05 10:30:39 ~9 min android 🤖apk 📲
✔️ 9b4ea2b #7 2023-09-05 10:30:44 ~9 min android-e2e 🤖apk 📲
✔️ 9b4ea2b #7 2023-09-05 10:31:10 ~10 min tests 📄log
✔️ 9b4ea2b #7 2023-09-05 10:31:49 ~10 min ios 📱ipa 📲

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.

LGTM

I am trying to set up unit tests for this part, but getting into some issues

Just out of curiosity, which problems @cammellos? Or better yet, what were you trying to test?

@cammellos
Copy link
Contributor Author

LGTM

I am trying to set up unit tests for this part, but getting into some issues

Just out of curiosity, which problems @cammellos? Or better yet, what were you trying to test?

I am trying to test the native java code we use for push notifications, ie this file:

modules/react-native-status/android/src/main/java/im/status/ethereum/pushnotifications/PushNotificationHelper.java

This is mocked in our unit tests, and only tested through e2e tests.
I would like to add some unit tests so that at least we can verify the behavior (it would not most likely have caught this, since this was a breaking change in status-go, but at least there's a way to test this as there's already a fair amount of logic)

Problems have mostly to do with dependencies etc, but I have solved them now, though I am still working through mocking/etc in the actual test

@ilmotta
Copy link
Contributor

ilmotta commented Sep 4, 2023

LGTM

I am trying to set up unit tests for this part, but getting into some issues

Just out of curiosity, which problems @cammellos? Or better yet, what were you trying to test?

I am trying to test the native java code we use for push notifications, ie this file:

modules/react-native-status/android/src/main/java/im/status/ethereum/pushnotifications/PushNotificationHelper.java

This is mocked in our unit tests, and only tested through e2e tests. I would like to add some unit tests so that at least we can verify the behavior (it would not most likely have caught this, since this was a breaking change in status-go, but at least there's a way to test this as there's already a fair amount of logic)

Problems have mostly to do with dependencies etc, but I have solved them now, though I am still working through mocking/etc in the actual test

👍🏼 Cool, definitely valuable to have unit test coverage there.

@cammellos cammellos force-pushed the bug/fix-push-notification-image branch 2 times, most recently from 4f2714b to e6e3d9a Compare September 4, 2023 19:38
Copy link
Member

Choose a reason for hiding this comment

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

🚀

Copy link
Member

@briansztamfater briansztamfater left a comment

Choose a reason for hiding this comment

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

It's excellent to see the implementation of unit tests for relevant Android native code. This is a great initiative, and I'm looking forward to delving deeper into this aspect.

I didn't find any major issues with the code. LGTM 👍

@siddarthkay
Copy link
Contributor

Hi @cammellos : I really like this attempt of adding tests to native android code!

I see you've added some gradle dependencies and for nix to be happy you will have to run make nix-update-gradle and push those deps.

This PR will require those 3 files will that get auto generated :

  • deps.list
  • deps.urls
  • deps.json

@siddarthkay
Copy link
Contributor

siddarthkay commented Sep 5, 2023

I tried to run tests locally and I saw a jsc-android error so you may have to add that as a dependency :
(It was my local environment)

Tests ran successfully on my machine make android-test took ~ 35 mins the 1st time

Screenshot 2023-09-05 at 1 52 05 PM

Second time they took ~ 11 mins

Screenshot 2023-09-05 at 2 22 35 PM

Makefile Outdated Show resolved Hide resolved
@cammellos cammellos force-pushed the bug/fix-push-notification-image branch from e6e3d9a to 78f1207 Compare September 5, 2023 09:08
@cammellos cammellos force-pushed the bug/fix-push-notification-image branch 2 times, most recently from a948335 to 9b4ea2b Compare September 5, 2023 10:20
@status-im-auto
Copy link
Member

84% of end-end tests have passed

Total executed tests: 43
Failed tests: 7
Passed tests: 36
IDs of failed tests: 702894,702786,702745,702731,702808,702732,703503 

Failed tests (7)

Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Device 1: Tap on found: Button
    Device 1: Find `Button` by `xpath`: `//*[@text="Contributors' test community"]`

    critical/test_public_chat_browsing.py:333: in test_community_discovery
        self.home.element_by_text(self.discovery_community_attributes[0]).click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//*[@text="Contributors' test community"]` 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_contact_block_unblock_offline, id: 702894

    Device 1: Click until ChatMessageInput by accessibility id: chat-message-input will be presented
    Device 1: Looking for a message by text: Hurray! unblocked

    critical/test_public_chat_browsing.py:965: in test_community_contact_block_unblock_offline
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Hurray! unblocked was not received in public chat after user unblock!
    



    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:441: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:187: 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
    



    Device sessions

    2. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 2: Find MemberPhoto by xpath: //*[starts-with(@text,'profile_photo')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='user-avatar']
    Device 2: Image differs from template to 7.650744868259804 percents

    critical/chats/test_1_1_public_chats.py:1127: in test_1_1_chat_non_latin_messages_stack_update_profile_photo
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Image of user in 1-1 chat is too different from template!
    



    Device sessions

    2. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_mentions_push_notification, id: 702786

    # STEP: Invited member gets push notification with the mention and tap it
    Device 2: Getting PN by 'user_2'

    critical/test_public_chat_browsing.py:1146: in test_community_mentions_push_notification
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Push notification with the mention was not received by admin
    E    Can not edit a message with a mention
    E    Push notification with the mention was not received by the invited member 
    

    [[Issue with username in PN, issue #6 in 15500]]

    Device sessions

    Passed tests (36)

    Click to expand

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    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

    3. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    4. test_community_undo_delete_message, id: 702869
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_navigation_jump_to, id: 702936
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    3. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    4. test_community_unread_messages_badge, id: 702841
    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_one_image_send_reply, id: 702859
    Device sessions

    8. test_community_message_edit, id: 702843
    Device sessions

    9. test_community_several_images_send_reply, id: 703194
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_reactions, id: 703202
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    4. test_group_chat_mute_chat, id: 703495
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_edit_message, id: 702855
    Device sessions

    2. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    3. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    4. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    5. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    6. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    7. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    8. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    9. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_leave, id: 702845
    Device sessions

    2. test_community_markdown_support, id: 702809
    Device sessions

    3. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    @churik churik mentioned this pull request Sep 5, 2023
    @status-im-auto
    Copy link
    Member

    79% of end-end tests have passed

    Total executed tests: 43
    Failed tests: 9
    Passed tests: 34
    
    IDs of failed tests: 702732,703086,702894,702745,703503,702786,702947,702731,702808 
    

    Failed tests (9)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_mentions_push_notification, id: 702786

    # STEP: Invited member gets push notification with the mention and tap it
    Device 2: Getting PN by 'user_2'

    critical/test_public_chat_browsing.py:1146: in test_community_mentions_push_notification
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Push notification with the mention was not received by admin
    E    Can not edit a message with a mention
    E    Push notification with the mention was not received by the invited member 
    

    [[Issue with username in PN, issue #6 in 15500]]

    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Device 1: Tap on found: Button
    Device 1: Find Button by xpath: //*[@text="Contributors' test community"]

    critical/test_public_chat_browsing.py:333: in test_community_discovery
        self.home.element_by_text(self.discovery_community_attributes[0]).click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//*[@text="Contributors' test community"]` 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 TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947

    Device 1: Find Button by accessibility id: close-activity-center
    Device 1: Tap on found: Button

    None; 
     RemoteDisconnected
    



    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    2. 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:440: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:187: 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
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 2: Find MemberPhoto by xpath: //*[starts-with(@text,'profile_photo')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='user-avatar']
    Device 2: Image differs from template to 7.685905905330882 percents

    critical/chats/test_1_1_public_chats.py:1127: in test_1_1_chat_non_latin_messages_stack_update_profile_photo
        self.errors.verify_no_errors()
    base_test_case.py:187: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Image of user in 1-1 chat is too different from template!
    



    Device sessions

    2. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_mark_all_messages_as_read, id: 703086

    Device 2: ChatMessageInput element not found
    Device 2: Sending message 'hello'

    critical/test_public_chat_browsing.py:1006: in test_community_mark_all_messages_as_read
        self.channel_2.send_message(self.text_message)
    ../views/chat_view.py:994: 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 `2`: `ChatMessageInput` by` accessibility id`: `chat-message-input` is not found on the screen after wait_for_element; 
     RemoteDisconnected
    



    Device sessions

    2. test_community_contact_block_unblock_offline, id: 702894

    Device 2: Accepting incoming CR for user_1
    Device 2: Find Button by xpath: //*[contains(@text, 'user_1')]/ancestor::*[@content-desc='activity']/*[@content-desc="accept-contact-request"]

    critical/test_public_chat_browsing.py:974: in test_community_contact_block_unblock_offline
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:366: in handle_contact_request
        chat_element.accept_contact_request()
    ../views/home_view.py:150: in accept_contact_request
        self.handle_cr("accept-contact-request")
    ../views/home_view.py:147: in handle_cr
        ).wait_for_rendering_ended_and_click()
    ../views/base_element.py:163: in wait_for_rendering_ended_and_click
        self.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: `//*[contains(@text, 'user_1')]/ancestor::*[@content-desc='activity']/*[@content-desc="accept-contact-request"]` 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

    Passed tests (34)

    Click to expand

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    3. test_community_leave, id: 702845
    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 TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495
    Device sessions

    2. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    3. test_group_chat_reactions, id: 703202
    Device sessions

    4. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    3. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    4. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    5. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    6. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    7. test_1_1_chat_edit_message, id: 702855
    Device sessions

    8. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    9. test_1_1_chat_message_reaction, id: 702730
    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_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    4. test_community_message_delete, id: 702839
    Device sessions

    5. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    6. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    7. test_community_message_edit, id: 702843
    Device sessions

    8. test_community_unread_messages_badge, id: 702841
    Device sessions

    @churik churik self-assigned this Sep 6, 2023
    @churik
    Copy link
    Member

    churik commented Sep 6, 2023

    @cammellos
    definitely an improvement in comparison with the current develop.
    also rechecked PNs on Andoroid 13 - works as expected, including fetching from offline, so likely 702808 fail will be addressed separately in PR.

    Thank you for the fix, awesome work!
    Glad that e2e are still finding hard-to-chase issue regardless of their stability.

    @cammellos cammellos force-pushed the bug/fix-push-notification-image branch from 9b4ea2b to 155f57c Compare September 6, 2023 13:09
    @cammellos cammellos merged commit 155f57c into develop Sep 6, 2023
    2 checks passed
    @cammellos cammellos deleted the bug/fix-push-notification-image branch September 6, 2023 13:09
    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.

    PNs delivery sometimes takes > 60 sec
    7 participants