Skip to content

Conversation

audriu
Copy link
Contributor

@audriu audriu commented Mar 10, 2022

fixes #13115

Summary

[comment]: # User can send messages to blocked contact so this commit disables chat input for chats with a blocked user.

Platforms

  • Android
  • iOS

Areas that maybe impacted

1-1 chats

Functional
  • 1-1 chats
Non-functional
  • user experience

Steps to test

  • chat with user user
  • block them
  • navigate to chat with them (user icon -> contacts -> blocked users)
  • observe chat input field is hidden

status: ready

@audriu audriu requested review from cammellos and jo-mut March 10, 2022 15:09
@audriu audriu self-assigned this Mar 10, 2022
@status-im-auto
Copy link
Member

status-im-auto commented Mar 10, 2022

Jenkins Builds

Click to see older builds (6)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 439f2da #1 2022-03-10 15:18:11 ~8 min android-e2e 📦apk 📲
✔️ 439f2da #1 2022-03-10 15:18:32 ~8 min android 📦apk 📲
✔️ 439f2da #1 2022-03-10 15:23:17 ~13 min ios 📦ipa 📲
✔️ 96657e6 #2 2022-03-10 18:45:42 ~8 min android-e2e 📦apk 📲
✔️ 96657e6 #2 2022-03-10 18:45:42 ~8 min android 📦apk 📲
✔️ 96657e6 #2 2022-03-10 18:50:15 ~12 min ios 📦ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 8c1b22e #4 2022-03-10 18:48:25 ~7 min android 📦apk 📲
✔️ 8c1b22e #4 2022-03-10 18:53:58 ~12 min ios 📦ipa 📲
✔️ 8f18e6d #3 2022-03-10 18:50:27 ~10 min ios 📦ipa 📲

@audriu audriu changed the title Disable chat input for chats with blocked users Disable chat input for chats with a blocked user Mar 10, 2022
@@ -1051,7 +1050,7 @@
(assoc :show-input? true)

(not group-chat)
(assoc :show-input? true)))))
(assoc :show-input? (not (contains? blocked-users-set chat-id)))))))
Copy link
Contributor

Choose a reason for hiding this comment

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

this might be slow, if there are many blocked users, honestly I don't think its a big issue, I wouldn't implement it because it harms performance for 99,9999% of valid chats , I don't see any issues with that user can write to blocked user

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be fairly quick though, blocked-users-set is a set, so it should be just constant time (O(1)), and not depending on set size

@audriu audriu force-pushed the bug/13115-disable-messaging-with-a-blocked-contact branch 4 times, most recently from 8c1b22e to dbdd4c7 Compare March 10, 2022 18:43
Signed-off-by: Audrius Molis <masta@dr.com>
@audriu audriu force-pushed the bug/13115-disable-messaging-with-a-blocked-contact branch from dbdd4c7 to 08da76c Compare March 10, 2022 18:45
@audriu audriu merged commit 08da76c into develop Mar 10, 2022
@audriu audriu deleted the bug/13115-disable-messaging-with-a-blocked-contact branch March 10, 2022 18:45
@status-im-auto
Copy link
Member

87% of end-end tests have passed

Total executed tests: 71
Failed tests: 9
Passed tests: 62
IDs of failed tests: 5762,6270,700764,6305,6253,5675,6263,6228,5387 

Failed tests (9)

Click to expand
  • Rerun tests

  • 1. test_pair_devices_sync_one_to_one_contacts_nicknames_public_chat, id: 5762

    Device 1: Looking for a message by text: I am blocked user
    Device 1: Find 'ChatElementByText' by 'xpath': `//*[starts-with(@text,'I am blocked user')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']`

    Device 1: ChatElementByText by xpath:`//*[starts-with(@text,'I am blocked user')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen

    Device sessions

    2. test_public_mark_all_messages_as_read, id: 6270

    Device 1: Find 'HomeButton' by 'xpath': `//*[contains(@content-desc,'tab, 1 out of 5')]`
    Device 1: Find 'HomeButton' by 'xpath': `//*[contains(@content-desc,'tab, 1 out of 5')]`

    New messages public chat badge is not shown on Home button

    Device sessions

    3. test_send_tx_token_7_decimals, id: 700764

    Device 1: ADI value is 499.9936999
    Device 1: Waiting 400s for ADI updated balance

    Device 1: Balance ADI 499.9936999 is not changed during 400 seconds!

    Device sessions

    4. test_image_in_one_to_one_send_save_reply_timeline, id: 6305

    Device 2: Find 'AllowButton' by 'xpath': `//*[@text="Allow" or @text="ALLOW"]`
    Device 2: Find 'Button' by 'xpath': `//*[@content-desc='open-gallery']/following-sibling::android.view.ViewGroup[1]`

    Status of another user not shown when open another user profile Status of another user not shown when open another user profile

    Device sessions

    5. test_send_eth_in_1_1_chat_transaction_push, id: 6253

    Transaction #5, amount is 0.0004441
    {'blockNumber': '12068211', 'timeStamp': '1646925501', 'hash': '0x420292edf1ea93a8a7c7298ebfe2c943e14b867a63d33da054cc55d68580a773', 'nonce': '36', 'blockHash': '0xcab4b5b299dc0abb4f4b4f225c81e3660d9d01cc883b6fc01ffd6f99003df015', 'transactionIndex': '50', 'from': '0x512543419b894307ea979c8d24219c279be2315b', 'to': '0xaa2c8fbfed0e36e793aa51707c4f575d2b7f2dc8', 'value': '444100000000000', 'gas': '21000', 'gasPrice': '163147453108', 'isError': '0', 'txreceipt_status': '1', 'input': '0x', 'contractAddress': '', 'cumulativeGasUsed': '7978666', 'gasUsed': '21000', 'confirmations': '551'}

    Transaction with amount 0.0001018119 is not found in list of ETH transactions, address is AA2C8FbfEd0e36E793aA51707C4F575D2B7f2dC8 during 300s

    Device sessions

    6. test_public_fetch_more_history, id: 5675

    ## Public chat 'ghkoyut' is created successfully!
    # STEP: Check that can fetch previous history for several days

    Device 1: "Mar 9, 2022" is not shown

    Device sessions

    7. test_request_and_receive_stt_in_1_1_chat_offline, id: 6263

    Transaction #5, amount is 0.00087154
    {'blockNumber': '12058425', 'timeStamp': '1646724454', 'hash': '0xc454e1f43aad69d917f3811fe92c52b02c48450a19ea014fc6863f52d1ccc803', 'nonce': '3', 'blockHash': '0x60596091c80b43bd7581431013cc1fadfc5353d056ae53afbfa1be8e25221ac3', 'from': '0xe67685fe27e269799c00c9e3474804bc65ac0208', 'contractAddress': '0xc55cf4b03948d7ebc8b9e8bad92643703811d162', 'to': '0x4df59a51d9eb357f1b9bae5b611c665f8a609983', 'value': '871540000000000', 'tokenName': 'Status Test Token', 'tokenSymbol': 'STT', 'tokenDecimal': '18', 'transactionIndex': '25', 'gas': '141028', 'gasPrice': '1000000374', 'gasUsed': '117524', 'cumulativeGasUsed': '7921205', 'input': 'deprecated', 'confirmations': '10344'}

    Transaction with amount 0.00010175753 is not found in list of token transactions, address is E67685fE27E269799C00C9e3474804BC65ac0208 during 300s

    Device sessions

    8. test_mobile_data_usage_complex_settings, id: 6228

    Device 1: Find 'Button' by 'xpath': `//*[@text="Use mobile data"]/following-sibling::android.widget.Switch[1]`
    Device 1: Find 'Button' by 'xpath': `//*[@text="Ask me when on mobile network"]/following-sibling::android.widget.Switch[1]`

    Not connected to history node after enabling fetching on mobile data Chat history was not fetched with mobile data fetching ON

    Device sessions

    9. test_delete_chats_via_delete_button_rejoin, id: 5387

    ## Public chat 'public-delete-long-press' is created successfully!
    Device 1: Looking for a message by text: test message:yyeqlqehqi

    Messages are not fetched when rejoining public chat after deleting

    Device sessions

    Passed tests (62)

    Click to expand

    1. test_can_add_existing_ens_on_mainnet, id: 5502
    Device sessions

    2. test_wallet_manage_assets, id: 700758
    Device sessions

    3. test_keycard_relogin_after_restore, id: 700768
    Device sessions

    4. test_can_use_purchased_stickers_on_recovered_account, id: 5783
    Device sessions

    5. test_keycard_create_login_restore_unlock_same_seed, id: 5689
    Device sessions

    6. test_public_chat_open_using_deep_link, id: 700739
    Device sessions

    7. test_public_delete_chat_long_press, id: 5319
    Device sessions

    8. test_send_eth_to_ens_in_chat, id: 6279
    Device sessions

    9. test_public_tag_message, id: 700738
    Device sessions

    10. test_send_tx_eth_check_logcat, id: 700763
    Device sessions

    11. test_reactions_to_message_in_chats, id: 6315
    Device sessions

    12. test_send_tx_custom_token_18_decimals_invalid_password, id: 700765
    Device sessions

    13. test_recover_set_up_wallet_sign_phrase, id: 700749
    Device sessions

    14. test_public_message_edit, id: 700734
    Device sessions

    15. test_open_blocked_secure_not_secure_inlalid_offline_urls, id: 6210
    Device sessions

    16. test_public_link_send_open, id: 700736
    Device sessions

    17. test_onboarding_add_new_multiaccount_username_by_position_pass_validation, id: 700747
    Device sessions

    18. test_onboarding_home_initial_popup, id: 700742
    Device sessions

    19. test_send_non_english_message_to_newly_added_contact_on_different_networks, id: 5315
    Device sessions

    20. test_restore_account_migrate_multiaccount_to_keycard, id: 6645
    Device sessions

    21. test_edit_delete_message_in_one_to_one_, id: 695843
    Device sessions

    22. test_public_links_with_previews_github_youtube_twitter_gif_send_enable, id: 700737
    Device sessions

    23. test_offline_is_shown_messaging_1_1_chat_sent_delivered, id: 5310
    Device sessions

    24. test_send_and_open_emoji_link_in_one_to_one, id: 5373
    Device sessions

    25. test_wallet_add_hide_unhide_account_private_key, id: 700761
    Device sessions

    26. test_block_user_from_public_chat, id: 5786
    Device sessions

    27. test_keycard_send_tx_sign_message_request_stt_testdapp, id: 700769
    Device sessions

    28. test_push_notification_1_1_chat_no_pn_activity_center, id: 6283
    Device sessions

    29. test_install_pack_and_send_sticker, id: 5782
    Device sessions

    30. test_add_and_remove_mention_contact_with_nickname_from_public_chat, id: 5332
    Device sessions

    31. test_browser_managing_bookmarks, id: 6633
    Device sessions

    32. test_onboarding_share_contact_address, id: 700743
    Device sessions

    33. test_onboarding_backup_seed_phrase_restore_same_login_logcat, id: 700745
    Device sessions

    34. test_wallet_tx_history_copy_tx_hash_on_lte, id: 700756
    Device sessions

    35. test_recover_uppercase_whitespaces_seed_phrase_special_char_passw_logcat, id: 700748
    Device sessions

    36. test_send_audio_message_with_push_notification_check, id: 6316
    Device sessions

    37. test_send_tx_set_recipient_options, id: 700757
    Device sessions

    38. test_onboarding_cant_sign_in_with_invalid_password_logcat, id: 700746
    Device sessions

    39. test_request_stt_from_dapp, id: 5309
    Device sessions

    40. test_open_chat_by_pasting_chat_key_check_invalid_chat_key_cases, id: 5304
    Device sessions

    41. test_wallet_add_delete_watch_only_account, id: 700760
    Device sessions

    42. test_set_profile_picture, id: 6646
    Device sessions

    43. test_delete_close_all_tabs, id: 5390
    Device sessions

    44. test_public_unread_messages_counter_for_mentions_relogin, id: 700718
    Device sessions

    45. test_onboarding_share_wallet_address, id: 700744
    Device sessions

    46. test_public_navigate_to_chat_when_relaunch, id: 5396
    Device sessions

    47. test_recover_validation_seed_phrase_field, id: 700750
    Device sessions

    48. test_wallet_fetching_balance_after_offline_insufficient_funds_errors, id: 700766
    Device sessions

    49. test_dapps_permissions, id: 5738
    Device sessions

    50. test_keycard_send_tx_eth, id: 700767
    Device sessions

    51. test_public_message_send_check_timestamps_while_on_different_tab, id: 5313
    Device sessions

    52. test_public_unread_messages_counter, id: 5360
    Device sessions

    53. test_wallet_add_account_generate_new, id: 700759
    Device sessions

    54. test_keycard_send_eth_in_1_1_chat, id: 6293
    Device sessions

    55. test_public_emoji_send_copy_paste_reply, id: 700719
    Device sessions

    56. test_public_message_delete, id: 700735
    Device sessions

    57. test_copy_and_paste_messages, id: 5317
    Device sessions

    58. test_ens_mentions_pn_and_nickname_in_public_and_1_1_chats, id: 6226
    Device sessions

    59. test_decline_transactions_in_1_1_chat_push_notification_changing_state, id: 6265
    Device sessions

    60. test_start_chat_with_ens_mention_in_one_to_one, id: 5403
    Device sessions

    61. test_keycard_wallet_recover_pairing_check_balance_after_offline_tx_history, id: 700770
    Device sessions

    62. test_sign_message_and_2tx_in_batch_and_transactions_filters_from_daap, id: 5342
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    tested in nightly builds. No issues were found.

    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.

    Disable messaging with a blocked contact
    5 participants