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

[#5138 #4851 #4865] periodic transaction state updates #5221

Merged
merged 1 commit into from Jul 20, 2018

Conversation

dmitryn
Copy link
Contributor

@dmitryn dmitryn commented Jul 18, 2018

Fixes #5138
Fixes #4851
Fixes #4865

Summary:

Fetch transactions state from etherscan every 15 seconds if there are any unconfirmed transactions or incoming chat transactions which are not synced to wallet.

status: ready

@dmitryn dmitryn self-assigned this Jul 18, 2018
@status-github-bot status-github-bot bot added this to REVIEW in Pipeline for QA Jul 18, 2018
@status-github-bot status-github-bot bot moved this from REVIEW to CONTRIBUTOR in Pipeline for QA Jul 18, 2018
@dmitryn dmitryn force-pushed the feature/perodic-transactions-updates-#5138 branch from 4193c9b to 2a36fa8 Compare July 18, 2018 13:55
@status-comment-bot
Copy link

status-comment-bot commented Jul 18, 2018

@status-github-bot status-github-bot bot moved this from CONTRIBUTOR to TO TEST in Pipeline for QA Jul 18, 2018
@statustestbot
Copy link

82% of end-end tests have passed

Total executed tests: 51
Failed tests: 9
Passed tests: 42

Failed tests (9)

Click to expand
1. test_home_view

Tap on HomeButton
Looking for an element by text: 'There are no recent Chats or DApps here yet. Tap the “Plus” button to see the list of Dapps or discover people to chat with.'

E Failed: Welcome image is not shown. 'Welcome to Status' text is not shown. 'Here you can chat with people in a secure private chat, browse and interact with DApps. Use the “Plus” icon to explore Status' text is not shown

Device sessions:

2. test_transaction_message_sending_from_wallet

Tap on SignTransactionButton
Looking for SignTransactionButton

E selenium.common.exceptions.StaleElementReferenceException: Message: android.support.test.uiautomator.StaleObjectException at android.support.test.uiautomator.UiObject2.getAccessibilityNodeInfo(UiObject2.java:629) at android.support.test.uiautomator.UiObject2.getVisibleBounds(UiObject2.java:210) at android.support.test.uiautomator.UiObject2.getVisibleCenter(UiObject2.java:251) at android.support.test.uiautomator.UiObject2.click(UiObject2.java:343) at io.appium.uiautomator2.model.UiObject2Element.click(UiObject2Element.java:45) at io.appium.uiautomator2.handler.Click.safeHandle(Click.java:40) at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:56) at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:208) at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:199) at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) at java.lang.Thread.run(Thread.java:761)

Device sessions:

3. test_offline_messaging_1_1_chat

Wait for ConnectionStatusText
Looking for ConnectionStatusText

E selenium.common.exceptions.NoSuchElementException: Message: 'ConnectionStatusText' is not found on screen, using: 'xpath://*[@content-desc='connection-status-text']/android.widget.TextView'

Device sessions:

4. test_token_with_more_than_allowed_decimals

Type '0.02365577' to AmountEditBox
Looking for an element by text: 'Amount is too precise. Max number of decimals is 7.'

E Failed: Warning about too precise amount is not shown when requesting a transaction

Device sessions:

5. test_request_and_receive_eth_in_1_1_chat

Looking for EthAssetText
EthAssetText is 76.070449108532787444

E selenium.common.exceptions.WebDriverException: Message:

504 Gateway Time-out

The server didn't respond in time.


Device sessions:

6. test_resend_message_offline

Wait for ConnectionStatusText
Looking for ConnectionStatusText

E selenium.common.exceptions.StaleElementReferenceException: Message: android.support.test.uiautomator.StaleObjectException at android.support.test.uiautomator.UiObject2.getAccessibilityNodeInfo(UiObject2.java:629) at android.support.test.uiautomator.UiObject2.getText(UiObject2.java:284) at io.appium.uiautomator2.model.UiObject2Element.getText(UiObject2Element.java:70) at io.appium.uiautomator2.handler.GetText.safeHandle(GetText.java:29) at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:56) at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:208) at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:199) at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435) at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611) at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:514) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:468) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) at java.lang.Thread.run(Thread.java:818)

Device sessions:

7. test_send_eth_from_wallet_to_contact

Tap on SignTransactionButton
Looking for GotItButton

E selenium.common.exceptions.NoSuchElementException: Message: 'GotItButton' is not found on screen, using: 'accessibility id:got-it-button'

Device sessions:

8. test_transaction_confirmed_on_sender_side

Looking for a transaction with unique amount 0.0718164832 in list of transactions, address is 616874dc6cc2810cdc930dea26496fcf217d58ca
Transaction with unique amount 0.0718164832 is found in list of transactions, address is 616874dc6cc2810cdc930dea26496fcf217d58ca

E Failed: Transaction with amount 0.0718164832 was not confirmed, address is 616874dc6cc2810cdc930dea26496fcf217d58ca

Device sessions:

9. test_transaction_confirmed_on_recipient_side

Transaction with unique amount 0.071816429 is found in list of transactions, address is 616874dc6cc2810cdc930dea26496fcf217d58ca
Looking for a message by text: '0.071816429'

E Failed: Transaction state is not updated on the recipient side

Device sessions:

Passed tests (42)

Click to expand
1. test_create_account
Device sessions:

2. test_filters_from_daap
Device sessions:

3. test_copy_and_paste_messages
Device sessions:

4. test_send_transaction_from_daap
Device sessions:

5. test_faucet_console_command
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_public_chat_messaging
Device sessions:

10. test_back_forward_buttons_browsing_website
Device sessions:

11. test_set_profile_picture
Device sessions:

12. test_text_message_1_1_chat
Device sessions:

13. test_add_to_contacts
Device sessions:

14. test_send_and_open_links
Device sessions:

15. test_copy_contact_code_and_wallet_address
Device sessions:

16. test_message_marked_as_sent_and_seen_1_1_chat
Device sessions:

17. test_send_token_with_7_decimals
Device sessions:

18. test_send_eth_from_wallet_to_address
Device sessions:

19. test_send_transaction_details_in_1_1_chat
Device sessions:

20. test_manage_assets
Device sessions:

21. test_wallet_set_up
Device sessions:

22. test_swipe_to_delete_public_chat
Device sessions:

23. test_send_emoji
Device sessions:

24. test_add_contact_by_pasting_public_key
Device sessions:

25. test_web3_block_number
Device sessions:

26. test_messaging_in_different_networks
Device sessions:

27. test_send_tokens_in_1_1_chat
Device sessions:

28. test_network_mismatch_for_send_request_commands
Device sessions:

29. test_swipe_to_delete_1_1_chat
Device sessions:

30. test_send_stt_from_wallet
Device sessions:

31. test_send_eth_in_1_1_chat
Device sessions:

32. test_login_with_new_account
Device sessions:

33. test_add_contact_from_public_chat
Device sessions:

34. test_send_request_not_enabled_tokens
Device sessions:

35. test_send_message_to_newly_added_contact
Device sessions:

36. test_backup_recovery_phrase
Device sessions:

37. test_offline_status
Device sessions:

38. test_open_google_com_via_open_dapp
Device sessions:

39. test_sign_message_from_daap
Device sessions:

40. test_share_contact_code_and_wallet_address
Device sessions:

41. test_request_eth_in_wallet
Device sessions:

42. test_recover_account
Device sessions:

@lukaszfryc lukaszfryc self-assigned this Jul 19, 2018
@status-github-bot status-github-bot bot moved this from TO TEST to CONTRIBUTOR in Pipeline for QA Jul 19, 2018
@lukaszfryc lukaszfryc moved this from CONTRIBUTOR to IN TESTING in Pipeline for QA Jul 19, 2018
@dmitryn dmitryn force-pushed the feature/perodic-transactions-updates-#5138 branch from 2a36fa8 to 7c5ec4d Compare July 19, 2018 10:27
@lukaszfryc
Copy link
Contributor

@dmitryn overall looks good. At least for a device that sends transactions (sender).

But, there was a case when I think we stopped updating the transaction state for receiver. I send ETH from chat, waited for 15 min, then took 2nd the device (receiver) and clicked on the incoming transaction message (it was pending) and saw 8 confirmations. I went to transaction history, refreshed the screen couple of times and but there was still only 8 confirmations. When I opened Etherscan and there were already 30 confirmations. When I go back to the 1st device (the one that sent the transaction) the number of confirmations was also correct.

Is there a timeout after which the app stops the polling? Is it the same for both sender and receiver?

@dmitryn
Copy link
Contributor Author

dmitryn commented Jul 19, 2018

@lukaszfryc it should poll the same way for both sender and receiver every 15 seconds, no matter what screen you're on and no matter of doing manual refresh or not.
Could you share TF session so i could check logs?

@status-comment-bot
Copy link

status-comment-bot commented Jul 19, 2018

@lukaszfryc
Copy link
Contributor

@dmitryn I could not found that session and I tested it once again. This time, I didn't have a situation when updating transaction stopped at 8 confirmations. Instead, all transactions went from pending -> confirmed and all confirmed transactions have no more than 12 confirmations. When I went to transaction history in wallet, they were updated to the last confirmation number like 38 and matched what's in Etherscan. Is it expected that the app stops fetching after 12 confirmations and if you really want to see all confirmations you need to go to transaction history?

If it's useful, here is TF session with part of the testing.

@dmitryn
Copy link
Contributor Author

dmitryn commented Jul 19, 2018

@lukaszfryc yes, it's expected. We stop automatic fetching once we don't have any unconfirmed transactions (we consider minimum 12 confirmations as the safe threshold).
If user really wants updated data he should refresh it manually. Maybe not very good for UX but this way we reduce mobile data and phone resources consumption.

@lukaszfryc
Copy link
Contributor

@dmitryn I totally agree with you. OK, let me test it a bit more and maybe compare network consumption between this PR and develop.

@lukaszfryc
Copy link
Contributor

@dmitryn I did 6 min tests where I waited for 12 confirmations. On this PR, the battery decreased by 0.11% (TF session), on nightly (976674) it was 0.10% (TF - sligthly cutted, but the whole session took the same amount of time). But, taking into account polling the app now does (which can be seen in TF), I think it is fine.

@lukaszfryc lukaszfryc moved this from IN TESTING to MERGE in Pipeline for QA Jul 20, 2018
@dmitryn
Copy link
Contributor Author

dmitryn commented Jul 20, 2018

@lukaszfryc thanks for testing, going to merge it now

Fetch transactions state from etherscan every 15 seconds
if there are any unconfirmed transactions

Signed-off-by: Dmitry Novotochinov <dmitry.novot@gmail.com>
@dmitryn dmitryn force-pushed the feature/perodic-transactions-updates-#5138 branch from 7c5ec4d to 2d6fdc0 Compare July 20, 2018 09:14
@dmitryn dmitryn merged commit 2d6fdc0 into develop Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants