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

Parse in status-go and render markdown #9409

Merged
merged 1 commit into from
Nov 15, 2019
Merged

Conversation

cammellos
Copy link
Member

@cammellos cammellos commented Nov 7, 2019

Fixes: status-im/trailofbits-audit#47
Fixes: status-im/trailofbits-audit#46
Fixes: status-im/trailofbits-audit#44
Fixes: status-im/security-reports#13
Fixes: status-im/security-reports#5
Fixes: #8995

This commits re-introduce rendering of markdown text and implent a few
changes:

  1. Parsing of the message content is now in status-go, this includes
    markdown, line-count, and rtl. Parsing is not nested, as there's some
    rendering degradation involved as we nest components, unclear exactly if
    it's react-native or clojure, haven't looked too deeply into it.
  2. Emojii type messages are now parsed on the receiver side, using the appropriate content-type
  3. Fixes a few issues with chat input rendering, currrently we use
    chats/current-chat subscription which is very heavy and should not be
    used unless necessary, and means that
    any change to chat will trigger a re-render, which caused re-rendering
    of input container on each received message. Also to note that
    input-container is fairly heavy to render, and it's rendered twice at
    each keypress on input.

Currently group chat messages are handled somewhat differently, and need to be passed to status-go to be parsed before rendering (similarly to outgoing messages). Both flows will be simplified once parsing of group chat updates is in status-go (it is already but seems like it's not working when a message is attached), and sending is fully in status-go.

The inline markdow supported is:

italic or italic
bold or bold
inline code
http://test.com links
#status-tag

The block markdown supported is:

# Headers

code blocks

Quotereply

The styling is very basic at the moment, but can be improved.
Adding other markdown (photo,mentions) is straightforward and should
come at little performance cost (unless the component to render is
heavy, i.e a photo for example).

There are some behavioral changes with this commit:

  1. Links are only parsed if starting with http:// or https://, meaning that
    blah.com won't be parsed, nor www.test.com. This behavior is consistent
    with discord for example and allows faster parsing at little expense to
    ser experience imo. Fixes a few security issues as well.

  2. Content is not anymore capped (regression), that's due to the fact that
    before we only rendered text and react-native allowed us easily to limit
    the number of lines, but adding markdown support means that this
    strategy is not viable anymore. Performance of rendering don't see to be
    very much impacted by this, I would re-introduce it if necessary, but
    I'd rather do that in a separate PR.

cc @errorists @rachelhamlin

status: ready
1-a
2-a

@cammellos cammellos requested a review from a team as a code owner November 7, 2019 13:43
@cammellos cammellos self-assigned this Nov 7, 2019
@status-github-bot
Copy link

Pull Request Checklist

  • Docs: Updated the documentation, if affected
  • Docs: Added or updated inline comments explaining intention of the code
  • Tests: Ensured that all new UI elements have been assigned accessibility IDs
  • Tests: Signaled need for E2E tests with label, if applicable
  • Tests: Briefly described what was tested and what platforms were used
  • UI: In case of UI changes, ensured that UI matches Figma
  • UI: In case of UI changes, requested review from a Core UI designer
  • UI: In case of UI changes, included screenshots of implementation

@status-im-auto
Copy link
Member

status-im-auto commented Nov 7, 2019

Jenkins Builds

Click to see older builds (64)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 6cb88db #2 2019-11-07 14:00:34 ~12 min ios 📦ipa 📲
✔️ 6cb88db #2 2019-11-07 14:01:21 ~12 min macos 📦dmg
✔️ 6cb88db #2 2019-11-07 14:02:53 ~14 min linux 📦App
✔️ 6cb88db #2 2019-11-07 14:03:12 ~14 min windows 📦exe
✔️ 6cb88db #2 2019-11-07 14:05:15 ~16 min android-e2e 📦apk 📲
✔️ 6cb88db #2 2019-11-07 14:07:50 ~19 min android 📦apk 📲
✔️ 5505bc5 #3 2019-11-07 15:00:01 ~10 min ios 📦ipa 📲
✔️ 5505bc5 #3 2019-11-07 15:02:46 ~13 min macos 📦dmg
✔️ 5505bc5 #3 2019-11-07 15:03:15 ~13 min windows 📦exe
✔️ 5505bc5 #3 2019-11-07 15:04:47 ~15 min linux 📦App
✔️ 5505bc5 #3 2019-11-07 15:09:44 ~20 min android-e2e 📦apk 📲
✔️ 5505bc5 #3 2019-11-07 15:10:01 ~20 min android 📦apk 📲
✔️ 68c356e #4 2019-11-07 17:37:21 ~9 min ios 📦ipa 📲
✔️ 68c356e #4 2019-11-07 17:40:27 ~13 min android-e2e 📦apk 📲
✔️ 68c356e #4 2019-11-07 17:40:42 ~13 min android 📦apk 📲
✔️ 68c356e #4 2019-11-07 17:41:02 ~13 min linux 📦App
✔️ 68c356e #4 2019-11-07 17:41:19 ~13 min windows 📦exe
✔️ 68c356e #4 2019-11-07 17:41:50 ~14 min macos 📦dmg
9c5dcb4 #5 2019-11-11 13:20:30 ~14 sec linux 📄log
9c5dcb4 #5 2019-11-11 13:20:30 ~16 sec android 📄log
9c5dcb4 #5 2019-11-11 13:20:30 ~13 sec macos 📄log
9c5dcb4 #5 2019-11-11 13:20:30 ~15 sec ios 📄log
9c5dcb4 #5 2019-11-11 13:20:31 ~13 sec windows 📄log
9c5dcb4 #5 2019-11-11 13:37:10 ~16 min android-e2e 📄log
c151198 #6 2019-11-11 13:51:26 ~12 min windows 📄log
c151198 #6 2019-11-11 13:51:57 ~13 min linux 📄log
c151198 #6 2019-11-11 13:52:14 ~13 min ios 📄log
c151198 #6 2019-11-11 13:52:49 ~14 min macos 📄log
c151198 #6 2019-11-11 13:56:41 ~18 min android-e2e 📄log
✔️ 526afdb #7 2019-11-11 14:05:44 ~9 min ios 📦ipa 📲
✔️ 277801f #8 2019-11-11 14:17:11 ~7 min ios 📦ipa 📲
✔️ 277801f #8 2019-11-11 14:20:05 ~10 min android 📦apk 📲
✔️ 277801f #8 2019-11-11 14:20:16 ~11 min android-e2e 📦apk 📲
✔️ 277801f #8 2019-11-11 14:22:46 ~13 min macos 📦dmg
✔️ 277801f #8 2019-11-11 14:24:06 ~14 min linux 📦App
✔️ 277801f #8 2019-11-11 14:25:18 ~16 min windows 📦exe
✔️ 89432a5 #9 2019-11-12 10:48:06 ~9 min ios 📦ipa 📲
✔️ 89432a5 #9 2019-11-12 10:50:10 ~11 min android-e2e 📦apk 📲
✔️ 89432a5 #9 2019-11-12 10:51:09 ~12 min android 📦apk 📲
✔️ 89432a5 #9 2019-11-12 10:51:17 ~12 min windows 📦exe
✔️ 89432a5 #9 2019-11-12 10:51:44 ~13 min macos 📦dmg
✔️ 89432a5 #9 2019-11-12 10:51:58 ~13 min linux 📦App
✔️ fd49435 #10 2019-11-12 13:19:01 ~13 min ios 📦ipa 📲
✔️ fd49435 #10 2019-11-12 13:19:12 ~13 min linux 📦App
✔️ fd49435 #10 2019-11-12 13:19:22 ~13 min windows 📦exe
✔️ fd49435 #10 2019-11-12 13:20:10 ~14 min macos 📦dmg
✔️ fd49435 #10 2019-11-12 13:23:23 ~17 min android-e2e 📦apk 📲
✔️ fd49435 #10 2019-11-12 13:23:39 ~18 min android 📦apk 📲
✔️ 008f45d #12 2019-11-13 11:07:08 ~12 min android-e2e 📦apk 📲
✔️ 008f45d #12 2019-11-13 11:07:09 ~12 min android 📦apk 📲
✔️ 008f45d #12 2019-11-13 11:09:05 ~14 min windows 📦exe
✔️ 008f45d #12 2019-11-13 11:09:05 ~14 min ios 📦ipa 📲
✔️ 720d0de #15 2019-11-13 11:29:15 ~9 min ios 📦ipa 📲
✔️ 720d0de #15 2019-11-13 11:32:30 ~12 min android-e2e 📦apk 📲
✔️ 720d0de #15 2019-11-13 11:32:36 ~12 min android 📦apk 📲
✔️ 720d0de #15 2019-11-13 11:33:04 ~13 min macos 📦dmg
✔️ 720d0de #15 2019-11-13 11:33:06 ~13 min linux 📦App
✔️ 720d0de #15 2019-11-13 11:33:20 ~13 min windows 📦exe
✔️ f327d5c #16 2019-11-13 14:19:10 ~13 min ios 📦ipa 📲
✔️ f327d5c #16 2019-11-13 14:22:15 ~16 min android-e2e 📦apk 📲
✔️ f327d5c #16 2019-11-13 14:22:20 ~16 min android 📦apk 📲
✔️ f327d5c #16 2019-11-13 14:24:36 ~18 min macos 📦dmg
✔️ f327d5c #16 2019-11-13 14:25:02 ~19 min windows 📦exe
✔️ f327d5c #16 2019-11-13 14:26:38 ~20 min linux 📦App
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 98eff83 #18 2019-11-13 18:55:23 ~10 min ios 📦ipa 📲
✔️ 98eff83 #18 2019-11-13 18:56:48 ~12 min android 📦apk 📲
✔️ 98eff83 #18 2019-11-13 18:58:00 ~13 min android-e2e 📦apk 📲
✔️ 98eff83 #18 2019-11-13 18:58:57 ~14 min macos 📦dmg
✔️ 98eff83 #18 2019-11-13 18:59:32 ~14 min windows 📦exe
✔️ 98eff83 #18 2019-11-13 18:59:49 ~15 min linux 📦App
✔️ 2b4f03c #19 2019-11-15 09:29:34 ~12 min windows 📦exe
✔️ 2b4f03c #19 2019-11-15 09:29:44 ~12 min linux 📦App
✔️ 2b4f03c #19 2019-11-15 09:29:56 ~13 min ios 📦ipa 📲
✔️ 2b4f03c #19 2019-11-15 09:32:04 ~15 min macos 📦dmg
✔️ 2b4f03c #19 2019-11-15 09:35:30 ~18 min android-e2e 📦apk 📲
✔️ 2b4f03c #19 2019-11-15 09:35:46 ~18 min android 📦apk 📲

@cammellos cammellos force-pushed the feature/add-parsing branch 2 times, most recently from 5505bc5 to 68c356e Compare November 7, 2019 17:27
@status-github-bot status-github-bot bot moved this from REVIEW to CONTRIBUTOR in Pipeline for QA Nov 8, 2019
@cammellos cammellos force-pushed the feature/add-parsing branch 4 times, most recently from 526afdb to 277801f Compare November 11, 2019 14:09
@cammellos
Copy link
Member Author

@Serhy I Have re-introduced markdown (code, bold, italic, http://link.com, and #tag) and fixed a few security issues in this PR:
https://github.com/status-im/trailofbits-audit/issues/46
https://github.com/status-im/security-reports/issues/13
and https://github.com/status-im/trailofbits-audit/issues/44

it's still a bit rough and there are few bugs here and there which I will address,
would you mind if you have time comparing rendering performance with develop to check that performance rendering messages is comparable (it seems like it is to me, but worth double checking). Some performance degradation is probably inevitable as current develop does not handle italic/bold/code but only links and #tag , but hopefully it's roughly the same.

Thanks!

@cammellos cammellos force-pushed the feature/add-parsing branch 2 times, most recently from 89432a5 to fd49435 Compare November 12, 2019 13:05
@cammellos
Copy link
Member Author

@Serhy
I have added support for some more markdown, could you check perf of the last build?

i have added support for:

# heading

> quote replies

\``` (remove the slash)
code blocks
\```

in addition to
**bold**
*italic*
http;//link.com
#status-tag

Thanks!

@Serhy
Copy link
Contributor

Serhy commented Nov 12, 2019

Tested performance behavior of message rendering of nested a) links and b) tags in this PR and current nightly develop build.
When user of Galaxy Note 4 navigates to public chat having 5 messages (2500 chars each with 250 items) time between tap and when messages appear in chat view takes:

Links (#links3 public channel)

build/attempt PR build (StatusIm-191112-103835-89432a-pr-universal.apk 12th Nov nightly build
Navigate with unread msg 6.6s 6.6s
Second navigate 6.4s 6.2s
Third navigate 6.3s 6.3s
Average 6.43s 6.36s

Tags (#tags public channel)

build/attempt PR build (StatusIm-191112-103835-89432a-pr-universal.apk 12th Nov nightly build
Navigate with unread msg 9.15s 8.75s
Second navigate 8.6s 8.5s
Third navigate 8.8s 8.33s
Average 8.85s 8.52s

Almost no changes (which I understand as good result here).
It makes sense to note that this morning I was checking also previous build (8th in Jenkins which is https://status-im-prs.ams3.digitaloceanspaces.com/StatusIm-191111-140910-277801-pr-universal.apk) and it's a bit faster for results. For example the same scenario with public chat having #tags takes ~6.8s (about 20% faster than develop)

@Serhy
I have added support for some more markdown, could you check perf of the last build?

Will check quotes, code, bold/italic formatting with next but no way to compare with current develop since we don't have such markdown for develop.

@Serhy
Copy link
Contributor

Serhy commented Nov 12, 2019

Below are the figures for markdown with 5 text messages, each message has 2500 chars and 250 items to parse. With the Galaxy Note 4 and https://status-im-prs.ams3.digitaloceanspaces.com/StatusIm-191112-130525-fd4943-pr-universal.apk build takes:

Navigate to chat attempt Bold Italic Code quote Quote Header
First (unread messages) 3.5s 3.9s 5.6s 1s 4.3s
Second 3.5s 3.9s 6s 0.9s 4.8s
Third 3.6s 3.8s 6.15s 1.03 5.2s
Average 3.53s 3.86s 5.91 0.97s 4.76s

Can't compare this figures with current develop because we don't have bold/italic/code markdown in develop and even more quotes and headers.

The last figures for performance measurements i found in #8263 (but it's before this issue fixed as closed).

Bold Italic Backquotes
16s 16s 26s

@cammellos
Copy link
Member Author

Thanks @Serhy! Would you say this are acceptable performance for develop? If so I can go ahead and polish the PR so that it gets merged.
Thanks!

@Serhy
Copy link
Contributor

Serhy commented Nov 13, 2019

Yes, @cammellos , absolutely. There is ~2% perf degradation between PR and Develop build, though it's not a big deal taking into account margins of error.

@cammellos cammellos force-pushed the feature/add-parsing branch 2 times, most recently from 639f4dc to 008f45d Compare November 13, 2019 10:54
@cammellos cammellos changed the title wip Parse in status-go and render markdown Nov 13, 2019
@cammellos cammellos force-pushed the feature/add-parsing branch 2 times, most recently from 5e63e92 to 8471461 Compare November 13, 2019 11:15
@errorists
Copy link
Contributor

thanks @cammellos yea syntax highlighting was a long shot, wanted to make you engineering guys happy :D

the code block:
background: #2E386B
text color: white
border: none
corner radius: 4px
font-family: let's do monospace for now, in future we'd like to look into deploying Roboto Mono specifically across all platforms
font-size / font-weight / line-height should all be inherited from regular text

inline-incoming

Inline quotes, incoming:
2px left border, border color: Grey from our palette (same as timestamps)
space between the border and text: 6px
font-size: 14
line-height: 19
text-color: rgba(0,0,0, 0.5) - so that's black with 50% opacity
2px of additional vertical margin between the quote and any regular text
font-family and font-weight are inherited from regular text

inline-outgoing

Outgoing inline quote
border-color: 40% white from our existing colour palette, that's rgba(255,255,255, 0.4)
text-colour: 70% white from our colour palette, that's rgba(255,255,255, 0.7)

@cammellos
Copy link
Member Author

@errorists updated

Copy link
Contributor

@corpetty corpetty left a comment

Choose a reason for hiding this comment

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

A few comments on questions.

(fx/merge cofx
{:db (assoc-in db [:chats current-chat-id :metadata :responding-to-message] nil)}
(chat.message/send-message {:chat-id current-chat-id
:content-type constants/content-type-text
:content-type (if emoji?
Copy link
Contributor

Choose a reason for hiding this comment

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

How does this work in the context of mixed text/emoji?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yeah good point, it gets rendered as massive text, probably best to validate that message, but will be in status-go, I am moving validation there, so I might do it in the scope of a separate PR

@@ -16,6 +16,10 @@
(deftest safe-link-test-exceptions
(testing "a javascript link"
(is (not (security/safe-link? "javascript://anything"))))
(testing "a javascript link mixed cases"
(is (not (security/safe-link? "JaVasCrIpt://anything"))))
Copy link
Contributor

Choose a reason for hiding this comment

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

if we're no longer rendering these as clickable, are they necessary?

@@ -24,7 +24,7 @@
data))

;; Links starting with javascript:// should not be handled at all
(def javascript-link-regex #"javascript://.*")
(def javascript-link-regex #"(?i)javascript://.*")
Copy link
Contributor

Choose a reason for hiding this comment

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

if we aren't rendering anything but http and https as clickable, are these needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

technically no, but given that status-go is a separate component, if there's any regression there, then status-react would blindly follow those links. This code is only run once the user clicks on a link, so performance is not impacted, therefore I would probably keep it, just to be on the safe side. what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't mind having multiple security checks like this.. i'd rather over validate than under.

@cammellos cammellos moved this from CONTRIBUTOR to E2E Tests in Pipeline for QA Nov 13, 2019
@statustestbot
Copy link

97% of end-end tests have passed

Total executed tests: 101
Failed tests: 3
Passed tests: 98

Failed tests (3)

Click to expand
1. test_send_and_open_links

Device 2: Wait for ChatMessageInput
Device 2: Looking for full text: 'status.im'

Device 2: 'OpenInStatusButton' is not found on the screen

Device sessions

2. test_collectible_from_wallet_opens_in_browser_view

Device 1: Tap on AccountElementButton
Device 1: Tap on CollectiblesButton

Device 1: 'CryptoKittiesInCollectiblesButton' is not found on the screen

Device sessions

3. test_send_two_transactions_one_after_another_in_dapp

Device 1: Tap on SignButton
Device 1: Wait for OkButton

Device 1: 'OkButton' is not found on the screen; also Unexpected Alert is shown: 'Consider it complete after 12 confirmations on the network.'

Device sessions

Passed tests (98)

Click to expand
1. test_user_can_switch_network
Device sessions

2. test_block_user_from_public_chat
Device sessions

3. test_filters_from_daap
Device sessions

4. test_copy_and_paste_messages
Device sessions

5. test_send_transaction_from_daap
Device sessions

6. test_onboarding_screen_when_requesting_tokens_for_recovered_account
Device sessions

7. test_connection_is_secure
Device sessions

8. test_deploy_contract_from_daap
Device sessions

9. test_redirect_to_public_chat_tapping_tag_message
Device sessions

10. test_remove_member_from_group_chat
Device sessions

11. test_delete_one_to_one_chat_via_delete_button
Device sessions

12. test_mobile_data_usage_popup_continue_syncing
Device sessions

13. test_clear_history_of_group_chat_via_group_view
Device sessions

14. test_decline_invitation_to_group_chat
Device sessions

15. test_open_transaction_on_etherscan
Device sessions

16. test_pass_phrase_validation
Device sessions

17. test_open_blocked_site
Device sessions

18. test_public_chat_messaging
Device sessions

19. test_open_chat_by_pasting_public_key
Device sessions

20. test_add_custom_token
Device sessions

21. test_long_press_to_delete_1_1_chat
Device sessions

22. test_password_in_logcat_sign_in
Device sessions

23. test_set_profile_picture
Device sessions

24. test_text_message_1_1_chat
Device sessions

25. test_add_to_contacts
Device sessions

26. test_sign_typed_message
Device sessions

27. test_home_view
Device sessions

28. test_unread_messages_counter_1_1_chat
Device sessions

29. test_can_use_purchased_stickers_on_recovered_account
Device sessions

30. test_ens_in_public_chat
Device sessions

31. test_logcat_send_transaction_from_daap
Device sessions

32. test_copy_contact_code_and_wallet_address
Device sessions

33. test_send_message_in_group_chat
Device sessions

34. test_always_allow_web3_permissions
Device sessions

35. test_can_open_dapp_from_dapp_store
Device sessions

36. test_recover_account_from_new_user_seedphrase
Device sessions

37. test_ens_username_recipient
Device sessions

38. test_logcat_send_transaction_from_wallet
Device sessions

39. test_account_recovery_with_uppercase_recovery_phrase
Device sessions

40. test_send_token_with_7_decimals
Device sessions

41. test_offline_messaging_1_1_chat
Device sessions

42. test_fetch_more_history_in_empty_chat
Device sessions

43. test_modify_transaction_fee_values
Device sessions

44. test_delete_group_chat_via_delete_button
Device sessions

45. test_token_with_more_than_allowed_decimals
Device sessions

46. test_send_eth_from_wallet_to_address
Device sessions

47. test_contact_profile_view
Device sessions

48. test_add_account_to_multiaccount_instance
Device sessions

49. test_send_funds_between_accounts_in_multiaccount_instance
Device sessions

50. test_manage_assets
Device sessions

51. test_create_new_group_chat
Device sessions

52. test_wallet_set_up
Device sessions

53. test_long_press_to_delete_public_chat
Device sessions

54. test_send_emoji
Device sessions

55. test_search_chat_on_home
Device sessions

56. test_block_user_from_one_to_one_header
Device sessions

57. test_logcat_recovering_account
Device sessions

58. test_mobile_data_usage_popup_stop_syncing
Device sessions

59. test_can_add_existing_ens
Device sessions

60. test_transaction_wrong_password_wallet
Device sessions

61. test_pair_devices_sync_name_photo_public_group_chats
Device sessions

62. test_install_pack_and_send_sticker
Device sessions

63. test_pair_devices_sync_one_to_one_contacts
Device sessions

64. test_delete_public_chat_via_delete_button
Device sessions

65. test_messaging_in_different_networks
Device sessions

66. test_logcat_backup_recovery_phrase
Device sessions

67. test_add_new_group_chat_member
Device sessions

68. test_logcat_sign_message_from_daap
Device sessions

69. test_switch_users_and_add_new_account
Device sessions

70. test_mobile_data_usage_settings
Device sessions

71. test_make_admin_member_of_group_chat
Device sessions

72. test_long_press_delete_clear_all_dapps
Device sessions

73. test_send_stt_from_wallet
Device sessions

74. test_login_with_new_account
Device sessions

75. test_insufficient_funds_wallet_positive_balance
Device sessions

76. test_request_public_key_status_test_daap
Device sessions

77. test_start_chat_with_ens
Device sessions

78. test_add_contact_from_public_chat
Device sessions

79. test_user_can_see_all_own_assets_after_account_recovering
Device sessions

80. test_send_message_to_newly_added_contact
Device sessions

81. test_password_in_logcat_creating_account
Device sessions

82. test_dapps_permissions
Device sessions

83. test_user_can_complete_tx_to_dapp_when_onboarding_via_dapp_completed
Device sessions

84. test_public_chat_clear_history
Device sessions

85. test_offline_status
Device sessions

86. test_open_google_com_via_open_dapp
Device sessions

87. test_unread_messages_counter_public_chat
Device sessions

88. test_sign_message_from_daap
Device sessions

89. test_user_can_remove_profile_picture
Device sessions

90. test_send_two_transactions_in_batch_in_dapp
Device sessions

91. test_share_contact_code_and_wallet_address
Device sessions

92. test_message_marked_as_sent_in_1_1_chat
Device sessions

93. test_fetching_balance_after_offline
Device sessions

94. test_need_help_section
Device sessions

95. test_refresh_button_browsing_app_webview
Device sessions

96. test_log_level_and_fleet
Device sessions

97. test_group_chat_system_messages
Device sessions

98. test_open_public_chat_using_deep_link
Device sessions

@cammellos cammellos moved this from E2E Tests to REVIEW in Pipeline for QA Nov 13, 2019
@cammellos cammellos moved this from REVIEW to E2E Tests in Pipeline for QA Nov 13, 2019
@statustestbot
Copy link

97% of end-end tests have passed

Total executed tests: 101
Failed tests: 3
Passed tests: 98

Failed tests (3)

Click to expand
1. test_sign_typed_message

Device 1: Tap on TransactionsButton
Device 1: Tap on SignTypedMessageButton

Device 1: 'EnterPasswordInput' is not found on the screen

Device sessions

2. test_send_and_open_links

Device 2: Wait for ChatMessageInput
Device 2: Looking for full text: 'status.im'

Device 2: 'OpenInStatusButton' is not found on the screen

Device sessions

3. test_start_chat_with_ens

Device 1: Wait for ChatMessageInput
Device 1: Wait for ChatMessageInput

Device 1: 'AddToContacts' is not found on the screen

Device sessions

Passed tests (98)

Click to expand
1. test_user_can_switch_network
Device sessions

2. test_block_user_from_public_chat
Device sessions

3. test_filters_from_daap
Device sessions

4. test_copy_and_paste_messages
Device sessions

5. test_send_transaction_from_daap
Device sessions

6. test_onboarding_screen_when_requesting_tokens_for_recovered_account
Device sessions

7. test_connection_is_secure
Device sessions

8. test_deploy_contract_from_daap
Device sessions

9. test_redirect_to_public_chat_tapping_tag_message
Device sessions

10. test_remove_member_from_group_chat
Device sessions

11. test_delete_one_to_one_chat_via_delete_button
Device sessions

12. test_mobile_data_usage_popup_continue_syncing
Device sessions

13. test_clear_history_of_group_chat_via_group_view
Device sessions

14. test_decline_invitation_to_group_chat
Device sessions

15. test_open_transaction_on_etherscan
Device sessions

16. test_pass_phrase_validation
Device sessions

17. test_open_blocked_site
Device sessions

18. test_public_chat_messaging
Device sessions

19. test_open_chat_by_pasting_public_key
Device sessions

20. test_add_custom_token
Device sessions

21. test_long_press_to_delete_1_1_chat
Device sessions

22. test_password_in_logcat_sign_in
Device sessions

23. test_set_profile_picture
Device sessions

24. test_text_message_1_1_chat
Device sessions

25. test_add_to_contacts
Device sessions

26. test_home_view
Device sessions

27. test_unread_messages_counter_1_1_chat
Device sessions

28. test_can_use_purchased_stickers_on_recovered_account
Device sessions

29. test_ens_in_public_chat
Device sessions

30. test_logcat_send_transaction_from_daap
Device sessions

31. test_copy_contact_code_and_wallet_address
Device sessions

32. test_collectible_from_wallet_opens_in_browser_view
Device sessions

33. test_send_message_in_group_chat
Device sessions

34. test_always_allow_web3_permissions
Device sessions

35. test_can_open_dapp_from_dapp_store
Device sessions

36. test_recover_account_from_new_user_seedphrase
Device sessions

37. test_ens_username_recipient
Device sessions

38. test_logcat_send_transaction_from_wallet
Device sessions

39. test_account_recovery_with_uppercase_recovery_phrase
Device sessions

40. test_send_token_with_7_decimals
Device sessions

41. test_offline_messaging_1_1_chat
Device sessions

42. test_fetch_more_history_in_empty_chat
Device sessions

43. test_modify_transaction_fee_values
Device sessions

44. test_delete_group_chat_via_delete_button
Device sessions

45. test_token_with_more_than_allowed_decimals
Device sessions

46. test_send_eth_from_wallet_to_address
Device sessions

47. test_contact_profile_view
Device sessions

48. test_add_account_to_multiaccount_instance
Device sessions

49. test_send_funds_between_accounts_in_multiaccount_instance
Device sessions

50. test_manage_assets
Device sessions

51. test_create_new_group_chat
Device sessions

52. test_wallet_set_up
Device sessions

53. test_long_press_to_delete_public_chat
Device sessions

54. test_send_emoji
Device sessions

55. test_search_chat_on_home
Device sessions

56. test_block_user_from_one_to_one_header
Device sessions

57. test_logcat_recovering_account
Device sessions

58. test_mobile_data_usage_popup_stop_syncing
Device sessions

59. test_can_add_existing_ens
Device sessions

60. test_transaction_wrong_password_wallet
Device sessions

61. test_pair_devices_sync_name_photo_public_group_chats
Device sessions

62. test_install_pack_and_send_sticker
Device sessions

63. test_pair_devices_sync_one_to_one_contacts
Device sessions

64. test_delete_public_chat_via_delete_button
Device sessions

65. test_messaging_in_different_networks
Device sessions

66. test_logcat_backup_recovery_phrase
Device sessions

67. test_add_new_group_chat_member
Device sessions

68. test_logcat_sign_message_from_daap
Device sessions

69. test_switch_users_and_add_new_account
Device sessions

70. test_mobile_data_usage_settings
Device sessions

71. test_make_admin_member_of_group_chat
Device sessions

72. test_long_press_delete_clear_all_dapps
Device sessions

73. test_send_stt_from_wallet
Device sessions

74. test_login_with_new_account
Device sessions

75. test_insufficient_funds_wallet_positive_balance
Device sessions

76. test_request_public_key_status_test_daap
Device sessions

77. test_add_contact_from_public_chat
Device sessions

78. test_user_can_see_all_own_assets_after_account_recovering
Device sessions

79. test_send_two_transactions_one_after_another_in_dapp
Device sessions

80. test_send_message_to_newly_added_contact
Device sessions

81. test_password_in_logcat_creating_account
Device sessions

82. test_dapps_permissions
Device sessions

83. test_user_can_complete_tx_to_dapp_when_onboarding_via_dapp_completed
Device sessions

84. test_public_chat_clear_history
Device sessions

85. test_offline_status
Device sessions

86. test_open_google_com_via_open_dapp
Device sessions

87. test_unread_messages_counter_public_chat
Device sessions

88. test_sign_message_from_daap
Device sessions

89. test_user_can_remove_profile_picture
Device sessions

90. test_send_two_transactions_in_batch_in_dapp
Device sessions

91. test_share_contact_code_and_wallet_address
Device sessions

92. test_message_marked_as_sent_in_1_1_chat
Device sessions

93. test_fetching_balance_after_offline
Device sessions

94. test_need_help_section
Device sessions

95. test_refresh_button_browsing_app_webview
Device sessions

96. test_log_level_and_fleet
Device sessions

97. test_group_chat_system_messages
Device sessions

98. test_open_public_chat_using_deep_link
Device sessions

@cammellos
Copy link
Member Author

@churik @Serhy I have updated the link test as we don't support status.im type links anymore, only http://status.im or https://status.im, the other failures don't seem to be related to this PR, could you please have a quick look?
Thanks!

@Serhy Serhy moved this from E2E Tests to TO TEST in Pipeline for QA Nov 14, 2019
@statustestbot
Copy link

100% of end-end tests have passed

Total executed tests: 3
Failed tests: 0
Passed tests: 3

Passed tests (3)

Click to expand
1. test_sign_typed_message
Device sessions

2. test_send_and_open_links
Device sessions

3. test_start_chat_with_ens
Device sessions

@Serhy Serhy moved this from TO TEST to IN TESTING in Pipeline for QA Nov 14, 2019
Copy link
Member

@rasom rasom left a comment

Choose a reason for hiding this comment

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

Can we make 80+ lines shorter? :)

@Serhy Serhy moved this from IN TESTING to MERGE in Pipeline for QA Nov 15, 2019
Fixes: status-im/trailofbits-audit#47
Fixes: status-im/trailofbits-audit#46
Fixes: status-im/trailofbits-audit#44
Fixes: status-im/security-reports#13
Fixes: status-im/security-reports#5
Fixes: #8995

This commits re-introduce rendering of markdown text and implent a few
changes:

1) Parsing of the message content is now in status-go, this includes
markdown, line-count, and rtl. Parsing is not nested, as there's some
rendering degradation involved as we nest components, unclear exactly if
it's react-native or clojure, haven't looked too deeply into it.
2) Emojii type messages are not parsed on the sending side, not the
receiving one, using the appropriate content-type
3) Fixes a few issues with chat input rendering, currrently we use
`chats/current-chat` subscription which is very heavy and should not be
used unless necessary, and means that
any change to chat will trigger a re-render, which caused re-rendering
of input container on each received message. Also to note that
input-container is fairly heavy to render, and it's rendered twice at
each keypress on input.

The inline markdow supported is:

*italic* or _italic_
**bold** or __bold__
`inline code`
http://test.com links
\#status-tag

The block markdown supported is:

\# Headers
```
code blocks
```
> Quotereply

The styling is very basic at the moment, but can be improved.
Adding other markdown (photo,mentions) is straightforward and should
come at little performance cost (unless the component to render is
heavy, i.e a photo for example).

There are some behavioral changes with this commit:

1) Links are only parsed if starting with http:// or https://, meaning that
blah.com won't be parsed, nor www.test.com. This behavior is consistent
with discord for example and allows faster parsing at little expense to
ser experience imo. Fixes a few security issues as well.

2) Content is not anymore capped (regression), that's due to the fact that
before we only rendered text and react-native allowed us easily to limit
the number of lines, but adding markdown support means that this
strategy is not viable anymore. Performance of rendering don't see to be
very much impacted by this, I would re-introduce it if necessary, but
I'd rather do that in a separate PR.

Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
@cammellos cammellos merged commit 9a9c0ce into develop Nov 15, 2019
Pipeline for QA automation moved this from MERGE to DONE Nov 15, 2019
@delete-merged-branch delete-merged-branch bot deleted the feature/add-parsing branch November 15, 2019 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

No text formatting (bold, italic) applied in chat for messages in asterisks (*) or underscores (_)
8 participants