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

Test react-native-desktop TextInput changes #6247

Merged
merged 1 commit into from
Oct 25, 2018
Merged

Conversation

vkjr
Copy link
Contributor

@vkjr vkjr commented Oct 10, 2018

Supplemental changes to react-native-desktop fixes - status-im/react-native-desktop-qt#365.

:on-submit-editing now supported in multiline TextInputs, so chat input was adjusted to use it.

Should be fixed right after status-im/react-native-desktop-qt#365

@vkjr vkjr added the desktop label Oct 10, 2018
@ghost
Copy link

ghost commented Oct 10, 2018

Pull Request Checklist

  • Have you updated the documentation, if impacted (e.g. docs.status.im)?

@vkjr vkjr changed the title Switched to rnd branch to test TextInput changes [WIP]Switched to rnd branch to test TextInput changes Oct 10, 2018
@status-comment-bot
Copy link

✅ CI BUILD SUCCESSFUL

Jenkins job: #1

Mobile
Desktop

@vkjr
Copy link
Contributor Author

vkjr commented Oct 10, 2018

@churik, could you please check that my changes in react-native-desktop has no negative impact on status-react?
Changes are TextInput component fixes all inputs affected.

@vkjr vkjr self-assigned this Oct 11, 2018
@vkjr vkjr changed the title [WIP]Switched to rnd branch to test TextInput changes Test react-native-desktop TextInput changes Oct 11, 2018
@SlizkovaGanna
Copy link

SlizkovaGanna commented Oct 11, 2018

@vkjr
Issues found within this PR:

1. Leftover input from a sent reply message when switching between chats

Steps to reproduce:

  1. Open two any chats for your user, one of them - with at leas 1 message from a contact
  2. Reply to a message (click on it and add a reply under a box with the message) and send it
  3. Click on a different chat to move to it
  4. Click on the previous chat to move back and check your message input field

Actual result:
The reply message you've already sent is displayed in your input message box again
Expected result:
Input message box should be empty

Additional data:
Video: https://monosnap.com/file/YFNFR82vHS2xpm8pKLSgsLeTajFsbV
Reproduces for MacOS and Linux. Not reproducible on nightly 11/10/18

2. Icons are broken when user is inserting data between the icons

Steps to reproduce:

  1. Open any chat
  2. Input a line of emojis (ex. 😌😩💁💕✌️🙈😄)
  3. Put your cursor in between any of them and start typing any text

Actual result:
Text starts to go past emojis, breaking the encoding in the process, check the screenshot below:

image

Expected result:
Text is inserted between the selected emojis, the emojis are not affected or changed in any way

Additional data:
Reproduces for MacOS and Linux. Not reproducible on nightly 11/10/18

3. Question - when switching between chats with input on 1 chat, should focus be at the end of text when you are switching back to 1 chat?

@yenda
Copy link
Contributor

yenda commented Oct 12, 2018

@SlizkovaGanna regarding 1. I think it's more a problem because of the hack that we used to go around this bug so we'll need to fix it in status-react. For 2. it's probably a problem with this fix ? @vkjr

@vkjr
Copy link
Contributor Author

vkjr commented Oct 17, 2018

@SlizkovaGanna, thanks for finding these!

@yenda, regarding 2 - yes, that was a bug, I fixed it.
regarding 1 - it is because TextInput was fixed :)
This code works on desktop differently from mobile - https://github.com/status-im/status-react/blob/develop/src/status_im/ui/screens/desktop/main/chat/views.cljs#L330
On mobile we press button, send message and clear input-text.
But on desktop we have following:

  1. user presses Enter
  2. we catch it in on-key-press and send message, plus clear input-text value in db and call clear() on TextInput
  3. after that on-change comes, because Enter is also key on desktop and that triggers setting input-text again. And we have a problem :)

Before that wasn't a problem because calling clear() on TextInput had a side effect of calling onChange. But it is wrong and mobile also doesn't behave like this. Now, when it is fixed, problem come up.

GitHub
a free (libre) open source, mobile OS for Ethereum - status-im/status-react

@vkjr
Copy link
Contributor Author

vkjr commented Oct 17, 2018

@yenda, do you have suggestion on how we can change clojure code to avoid this? Theoretically we can set some flag when message sent and do not process onChange that comes right after sending. But that looks a bit... okay not a bit, just ugly :)

@yenda
Copy link
Contributor

yenda commented Oct 18, 2018

@vkjr after cleaning up the input field to have it like the one in mobile, it still doesn't have the same behavior. When sending the message with the button, it doesn't empty the input-field as it does in mobile.

@yenda
Copy link
Contributor

yenda commented Oct 18, 2018

I also got a few crashes:

"UIManager:" ::manageChildren for containerReactTag:  28275  moveFromIndicies:  (0)  moveToIndices:  (1)  addChildReactTags:  ()  addAtIndices:  ()  removeAtIndices:  ()
"UIManager:" ::manageChildren container->childItems().size():  0
"UIManager:" ::manageChildren container->childItems():  ()
"Flexbox:" utilities::removeFlexboxChilds remove children at indexes (0)  from parent item:  ReactView_QMLTYPE_33(0x5650ef2dc8b0, parent=0x0, geometry=0,0 340x328)  parent flexbox:  Flexbox(0x5650ef2dcf70)
"Flexbox:" ::removeChilds YGNode:  0x5650ef228e50  will be removed at index:  0  from:  Flexbox(0x5650ef2dcf70)
"UIManager:" ::manageChildren containerFlexbox->addChild Parent container:  ReactView_QMLTYPE_33(0x5650ef2dc8b0, parent=0x0, geometry=0,0 340x328)  parent container flexbox:  Flexbox(0x5650ef2dcf70)  Child item:  ReactView_QMLTYPE_33(0x5650ef280c90, parent=0x5650ef2e85b0, geometry=0,0 340x94)  child flexbox:  Flexbox(0x5650ef281aa0)  position to add at:  1
"Flexbox:" ::addChild new YGNode:  0x5650ef281b50  for flexbox:  Flexbox(0x5650ef281aa0)  will be inserted at:  1  into parent:  Flexbox(0x5650ef2dcf70)
Child already has a owner, it must be removed first.
Received signal 6
#0 0x7f529dc7452f <unknown>
#1 0x7f529c6a5b1d <unknown>
#2 0x7f529dc74a3e <unknown>
#3 0x7f530418b890 <unknown>
#4 0x7f5303482e97 gsignal
#5 0x7f5303484801 abort
#6 0x5650db0b149c YGVLog()
#7 0x5650db0b165b YGLog
#8 0x5650db0b16fa YGAssertWithNode
#9 0x5650db0a1d68 YGNodeInsertChild
#10 0x5650db0889a2 Flexbox::addChild()
#11 0x5650db064a3d UIManager::manageChildren()
#12 0x5650db0387f7 UIManager::qt_static_metacall()
#13 0x7f530460a4c9 QMetaMethod::invoke()
#14 0x5650db0504d9 QMetaMethod::invoke()
#15 0x5650db04f77f ModuleMethod::invoke()
#16 0x5650db044325 Bridge::invokeModuleMethod()
#17 0x5650db02d47d Bridge::qt_static_metacall()
#18 0x7f530462a0e1 QObject::event()
#19 0x7f53045fe2d8 QCoreApplication::notifyInternal2()
#20 0x7f5304600ceb QCoreApplicationPrivate::sendPostedEvents()
#21 0x7f5304652d93 postEventSourceDispatch()
#22 0x7f5300242287 g_main_context_dispatch
#23 0x7f53002424c0 <unknown>
#24 0x7f530024254c g_main_context_iteration
#25 0x7f53046523ff QEventDispatcherGlib::processEvents()
#26 0x7f52fc3160d1 QPAEventDispatcherGlib::processEvents()
#27 0x7f53045fcc3a QEventLoop::exec()
#28 0x7f5304605640 QCoreApplication::exec()
#29 0x5650db01d659 main
#30 0x7f5303465b97 __libc_start_main
#31 0x5650db01c3da _start
  r8: 0000000000000000  r9: 00007ffdecf0b8b0 r10: 0000000000000008 r11: 0000000000000246
 r12: 0000000000000001 r13: 0000000000000007 r14: 00005650de1385e0 r15: 00005650dc2ac920
  di: 0000000000000002  si: 00007ffdecf0b8b0  bp: 00007ffdecf0bb40  bx: 00005650ef281b50
  dx: 0000000000000000  ax: 0000000000000000  cx: 00007f5303482e97  sp: 00007ffdecf0b8b0
  ip: 00007f5303482e97 efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.

@vkjr
Copy link
Contributor Author

vkjr commented Oct 19, 2018

@yenda, yeah, I also have crashes. Checking now.

@vkjr vkjr force-pushed the fix/message_input_vkjr3 branch 2 times, most recently from 92fbb68 to d169d28 Compare October 24, 2018 09:22
@status-comment-bot
Copy link

✅ CI BUILD SUCCESSFUL

Jenkins job: #3

Mobile
Desktop

@vkjr
Copy link
Contributor Author

vkjr commented Oct 24, 2018

@SlizkovaGanna, could you please check again. Problems you mentioned fixed now

@statustestbot
Copy link

90% of end-end tests have passed

Total executed tests: 60
Failed tests: 6
Passed tests: 54

Failed tests (6)

Click to expand
1. test_offline_messaging_1_1_chat

Device 2: Type 'test message' to ChatMessageInput
Device 2: Tap on SendMessageButton

Device 1: 'ConnectionStatusText' is still visible on the screen after 20 seconds

Device sessions

2. test_modify_transaction_fee_values

Device 1: Tap on SignTransactionButton
Device 1: Looking for an element by text: 'intrinsic gas too low'

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

Device sessions

3. test_onboarding_screen_is_shown_for_account_when_requesting_tokens

Device 1: Wait for RequestSTTButton
Device 1: Wait for RequestSTTButton

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

Device sessions

4. test_send_tokens_in_1_1_chat

Device 2: Wait for CreateAccountButton
Device 1: Wait for OtherAccountsButton

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

Device sessions

5. test_network_mismatch_for_send_request_commands

Device 1: Tap on GotItButton
Device 1: Looking for a message by text: '0.0102414421'

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

Device sessions

6. test_offline_status
Infrastructure Error -- The Sauce VMs failed to start the browser or device. For more info, please check https://wiki.saucelabs.com/display/DOCS/Common+Error+Messages

Passed tests (54)

Click to expand
1. test_create_account
Device sessions

2. test_user_can_switch_network
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_request_and_receive_tokens_in_1_1_chat
Device sessions

7. test_delete_cut_and_paste_messages
Device sessions

8. test_deploy_contract_from_daap
Device sessions

9. test_offline_login
Device sessions

10. test_pass_phrase_validation
Device sessions

11. test_public_chat_messaging
Device sessions

12. test_back_forward_buttons_browsing_website
Device sessions

13. test_password_in_logcat_sign_in
Device sessions

14. test_set_profile_picture
Device sessions

15. test_text_message_1_1_chat
Device sessions

16. test_add_to_contacts
Device sessions

17. test_unread_messages_counter_1_1_chat
Device sessions

18. test_logcat_send_transaction_from_daap
Device sessions

19. test_privacy_policy_is_accessible
Device sessions

20. test_logcat_send_transaction_from_wallet
Device sessions

21. test_send_token_with_7_decimals
Device sessions

22. test_token_with_more_than_allowed_decimals
Device sessions

23. test_send_eth_from_wallet_to_address
Device sessions

24. test_send_transaction_details_in_1_1_chat
Device sessions

25. test_manage_assets
Device sessions

26. test_wallet_set_up
Device sessions

27. test_logcat_send_transaction_in_1_1_chat
Device sessions

28. test_request_and_receive_eth_in_1_1_chat
Device sessions

29. test_swipe_to_delete_public_chat
Device sessions

30. test_passphrase_whitespaces_ignored_while_recovering_access
Device sessions

31. test_send_emoji
Device sessions

32. test_add_contact_by_pasting_public_key
Device sessions

33. test_logcat_recovering_account
Device sessions

34. test_messaging_in_different_networks
Device sessions

35. test_logcat_sign_message_from_daap
Device sessions

36. test_swipe_to_delete_1_1_chat
Device sessions

37. test_switch_users_and_add_new_account
Device sessions

38. test_send_stt_from_wallet
Device sessions

39. test_send_eth_in_1_1_chat
Device sessions

40. test_login_with_new_account
Device sessions

41. test_send_eth_from_wallet_to_contact
Device sessions

42. test_add_contact_from_public_chat
Device sessions

43. test_send_request_not_enabled_tokens
Device sessions

44. test_send_message_to_newly_added_contact
Device sessions

45. test_password_in_logcat_creating_account
Device sessions

46. test_backup_recovery_phrase
Device sessions

47. test_open_google_com_via_open_dapp
Device sessions

48. test_unread_messages_counter_public_chat
Device sessions

49. test_sign_message_from_daap
Device sessions

50. test_share_contact_code_and_wallet_address
Device sessions

51. test_request_eth_in_wallet
Device sessions

52. test_refresh_button_browsing_app_webview
Device sessions

53. test_backup_recovery_phrase_warning_from_wallet
Device sessions

54. test_recover_account
Device sessions

@SlizkovaGanna
Copy link

SlizkovaGanna commented Oct 24, 2018

No issues found. Old issues are indeed fixed.

The failed test #1 is unrelated to those changes.

Tested on MacOS 10.13.4

@vkjr vkjr requested review from vitvly, yenda and maxhora October 24, 2018 15:57
@vkjr
Copy link
Contributor Author

vkjr commented Oct 24, 2018

@yenda, @Maxris, @siphuel, could you please review small change in chat input? I'll remove changes in package.json and package-lock.json before merge.

@vkjr
Copy link
Contributor Author

vkjr commented Oct 24, 2018

@SlizkovaGanna, could you please put Tested-OK label if no problems found?

@vkjr vkjr force-pushed the fix/message_input_vkjr3 branch from d169d28 to 7e9d7c7 Compare October 25, 2018 07:36
@status-comment-bot
Copy link

✅ CI BUILD SUCCESSFUL

Jenkins job: #4

Mobile
Desktop

@vkjr vkjr force-pushed the fix/message_input_vkjr3 branch from 7e9d7c7 to 0bc9fb6 Compare October 25, 2018 08:02
@vkjr vkjr merged commit 0bc9fb6 into develop Oct 25, 2018
@status-comment-bot
Copy link

✅ CI BUILD SUCCESSFUL

Jenkins job: #5

Mobile
Desktop

@rasom rasom deleted the fix/message_input_vkjr3 branch January 11, 2019 17:20
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.

8 participants