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

[Fix] Crash on onboarding due to nil value #16884

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

smohamedjavid
Copy link
Member

fixes #16883

Summary

This PR fixes the crash on the New to status screen to due usage of when inside the vector which produces nil value.

Platforms

  • Android
  • iOS

Steps to test

  • Open Status
  • Navigate to the New to status screen
  • Check whether the app crashes or not

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Aug 4, 2023

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a8a48bf #1 2023-08-04 10:07:55 ~6 min android-e2e 🤖apk 📲
✔️ a8a48bf #1 2023-08-04 10:07:56 ~6 min android 🤖apk 📲
✔️ a8a48bf #1 2023-08-04 10:11:01 ~9 min tests 📄log
✔️ a8a48bf #2 2023-08-04 10:23:13 ~9 min ios 📱ipa 📲

@status-im-auto
Copy link
Member

88% of end-end tests have passed

Total executed tests: 41
Failed tests: 5
Passed tests: 36
IDs of failed tests: 702894,702731,702809,703133,702732 

Failed tests (5)

Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_contact_block_unblock_offline, id: 702894

    Device 1: Tap on found: Button
    Device 1: Looking for a message by text: Hurray! unblocked

    critical/test_public_chat_browsing.py:927: in test_community_contact_block_unblock_offline
        self.errors.verify_no_errors()
    base_test_case.py:183: 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

    2. test_community_markdown_support, id: 702809

    # STEP: Checking that "bold text in asterics" is applied (**) in 1-1 chat
    Device 1: Sending message 'bold text in asterics'

    critical/test_public_chat_browsing.py:1104: in test_community_markdown_support
        chat_1.send_message(message_to_send)
    ../views/chat_view.py:968: in send_message
        self.chat_message_input.wait_for_element(wait_chat_input_sec)
    ../views/base_element.py:117: 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 TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

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

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Restoring communities issue: 16787; restoring contacts issue: 15500]]

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

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

    Passed tests (36)

    Click to expand

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_leave, id: 702845
    Device sessions

    2. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    3. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    4. test_community_mentions_push_notification, id: 702786
    Device sessions

    5. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    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_send_check_timestamps_sender_username, id: 702838
    Device sessions

    9. test_community_one_image_send_reply, id: 702859
    Device sessions

    10. test_community_message_edit, id: 702843
    Device sessions

    11. 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 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_activity_center_mentions, id: 702957
    Device sessions

    4. test_navigation_jump_to, id: 702936
    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_community_undo_delete_message, id: 702869
    Device sessions

    4. test_community_mute_community_and_channel, id: 703382
    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_offline_pn, id: 702808
    Device sessions

    4. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    5. 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_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    5. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    6. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    7. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    8. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    9. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    10. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    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 @smohamedjavid. Just left a comment that's not a blocker at all.

    [:show-bottom-sheet
    {:content getting-started-doc
    :shell? true}])}]}]])
    :right-section-buttons (cond-> [{:type :grey
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    The more future proof solution is to change right-section-buttons to deal with nils (just filter them out), since it's quite common to use when to build up vectors. For example, re-frame even mentions this as one of the features of its :fx effect.

    if any element of :fx is nil, it will be ignored. This allows effects to be conditionally included via a when (an example is given above)

    -- https://day8.github.io/re-frame/releases/2020/

    Although cond-> is just fine, the better fix imo is to make page-nav more resilient.

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    if any element of :fx is nil, it will be ignored. This allows effects to be conditionally included via a when (an > example is given above)

    This is really helpful. Thanks for sharing!

    I agree @ilmotta. We should this filter in all the component which receives a vector to prevent these types of crashes.

    I faced this same issue when I was refactoring the action-drawer component, I added a filter to prevent it.

    (let [filtered-actions (filter some? actions)]

    the better fix imo is to make page-nav more resilient

    I will add the filter in a separate PR 👍

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    @ulisesmac is looking into that component I believe :)

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Yes, I will improve our page-nav component 👍

    @pavloburykh
    Copy link
    Contributor

    @smohamedjavid thanx for the fix

    Tested e2e, universal pr builds (on android and ios), nightly build (on ios). Was not able to test nighty build on android and release builds on ios and android, because builds are failing for some reason when trying to build manually in jenkins. But it is not PR problem I guess.

    Let's merge this PR.

    @smohamedjavid smohamedjavid merged commit bad9aa9 into develop Aug 4, 2023
    @smohamedjavid smohamedjavid deleted the fix/crash-on-onboarding branch August 4, 2023 11:52
    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.

    App crashes with "Doesn't support name" error during onboarding (BLOCKER)
    8 participants