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

request messages history after background #3493

Closed

Conversation

rasom
Copy link
Contributor

@rasom rasom commented Mar 1, 2018

fixes #3467

status: ready

@rasom rasom force-pushed the bugfix/request-history-on-network-or-app-state-changes branch from 46a3049 to 40466d8 Compare March 1, 2018 16:01
@rasom rasom self-assigned this Mar 1, 2018
@rasom rasom force-pushed the bugfix/request-history-on-network-or-app-state-changes branch from b887034 to 2b4615d Compare March 2, 2018 07:27
@rasom
Copy link
Contributor Author

rasom commented Mar 2, 2018

testcase №1

  1. device A enters background
  2. wait 2 min
  3. send a message from B
  4. wait 2 min
  5. turn on airplane mode on A
  6. send a message from B
  7. close app on B
  8. wait 2 min
  9. open app on A
  10. turn off airplane mode on A

@@ -111,6 +111,12 @@
(defn now-ms []
(to-long (now)))

(defn now-s! []
Copy link
Member

Choose a reason for hiding this comment

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

what the purpose of ! ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

side effect in this case, though we don't have a convention

Copy link
Contributor

Choose a reason for hiding this comment

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

Since now-ms doesn't have a bang I wouldn't put one here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@flexsurfer flexsurfer requested review from yenda and janherich March 2, 2018 09:42
@oskarth
Copy link
Contributor

oskarth commented Mar 6, 2018

@rasom WDYT about resolving conflicts and getting this (tested&)merged, even if it isn't 100% covering all cases yet?

:web3 web3}})))
(when web3
(let [wnode-id (get db :inbox/wnode)
wnode (get-in db [:inbox/wnodes wnode-id :address])]
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there's a fn get-wnode or something, Eric used this in other PR

@rasom rasom force-pushed the bugfix/request-history-on-network-or-app-state-changes branch from a542f6a to d934a44 Compare March 10, 2018 15:18
@rasom
Copy link
Contributor Author

rasom commented Mar 10, 2018

conflicts resolved, let's test it

@statustestbot
Copy link

53% of end-end tests have passed

Total executed tests: 15
Failed tests: 7
Passed tests: 8

Failed tests (7)

Click to expand
1. test_send_transaction_from_daap

Tap on ToggleNavigationButton
Looking for NewAuctionButton

E selenium.common.exceptions.NoSuchElementException: Message: 'NewAuctionButton' is not found on screen, using: 'accessibility id:New Auction'

Device sessions:

2. test_send_eth_from_wallet_sign_now

Looking for OkButton

E selenium.common.exceptions.WebDriverException: Message: The test with session id 7ba791baa3a249209c440bea8690904f has already finished, and can't receive further commands. You can learn more at https://saucelabs.com/jobs/7ba791baa3a249209c440bea8690904f For help, please check https://wiki.saucelabs.com/display/DOCS/Common+Error+Messages

3. test_one_to_one_chat_messages_and_delete_chat

Wait for PlusButton
Looking for an element by text part: 'Test Name'

E Failed: Message with text "abc !@#$%%^&(() bold" was not received

Device sessions:

4. test_network_switch

Tap on ProfileButton
Looking for full text: 'RINKEBY WITH UPSTREAM RPC'

E selenium.common.exceptions.TimeoutException: Message: 'BaseElement' is not found on screen, using: 'xpath://*[@text="RINKEBY WITH UPSTREAM RPC"]', during '20' seconds

Device sessions:

5. test_group_chat_messages

Scrolling down to UsernameCheckbox
Looking for UsernameCheckbox

E selenium.common.exceptions.NoSuchElementException: Message: 'UsernameCheckbox' is not found on screen, using: 'xpath://*[@text='Test Name']/../../android.view.ViewGroup[2]/*'

Device sessions:

6. test_transaction_send_command_one_to_one_chat

Waiting 290 seconds for donation
Waiting 300 seconds for donation

E Failed: Donation was not received during 300 seconds!

Device sessions:

7. test_send_eth_to_request_in_one_to_one_chat

Looking for an element by text part: 'Evergreen Handsome Cotton'
Looking for an element by text part: 'Brief Organic Xenops'

E selenium.common.exceptions.NoSuchElementException: Message: 'BaseButton' is not found on screen, using: 'xpath://*[contains(@text, "Brief Organic Xenops")]'

Device sessions:

Passed tests (8)

Click to expand
1. test_send_eth_to_request_from_wallet
Device sessions:

2. test_public_chat
Device sessions:

3. test_browse_link_entering_url_in_dapp_view
Device sessions:

4. test_transaction_send_command_wrong_password
Device sessions:

5. test_send_stt_from_wallet_via_enter_recipient_address
Device sessions:

6. test_send_eth_to_request_in_group_chat
Device sessions:

7. test_transaction_send_command_group_chat
Device sessions:

8. test_send_eth_from_wallet_sign_later
Device sessions:

@@ -71,6 +72,11 @@
(fn [coeffects _]
(assoc coeffects :now (time/now-ms))))

(re-frame/reg-cofx
Copy link
Contributor

Choose a reason for hiding this comment

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

since we already have now and it is a coeffect added to all event, I think it is better to just have an to-s function that turns now into now-s rather than a second coeffect that also produces a timestamp

Copy link
Member

Choose a reason for hiding this comment

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

yeah thought also about this

@lukaszfryc lukaszfryc self-assigned this Mar 13, 2018
@lukaszfryc
Copy link
Contributor

I tested it on Android 7 (Samsung Galaxy S8) and iOS 11.2.1 (iPhone 6). Here is what I found.

  1. No new 1-1 message after going back online from long offline session (~4 min). Happens on Android and iOS
    a. Transit app to background on device A
    b. Turn on airplane mode on device A
    c. Send message from device B to device A
    d. Close app on device B
    e. Wait 3-5 minutes
    f. Turn off airplane mode on device A
    g. Wait for message notification and open the chat
    Now, device A receives notification but the chat does not have the new message. The message is received when app on device B is opened and user is logged again.
    Everyting works fine when device A is offline only for very short period of time.

  2. Group chat message is not received after going back online from long offline session (~4 min). Tested only on Android
    Like in 1) a new group chat message is not received when device was offline for a long period of time. The difference is that the message is not received even when the second device opens the app (and group chat) or sends another message. Looks like the message is basically lost.
    Here is the scenario:
    a. Create group chat for devices A and B
    b. Send some messages between devices in the group chat
    c. Turn on airplane mode on device A
    d. Send group chat message on device B
    e. Wait for 3-5 min
    f. Turn off airplane mode on device A
    Device A will not receive the message that was sent before going offline.
    @rasom could this be an issue on our side or it's just the way the protocol works at this moment?

@statustestbot
Copy link

56% of end-end tests have passed

Total executed tests: 16
Failed tests: 7
Passed tests: 9

Failed tests (7)

Click to expand
1. test_send_eth_from_wallet_sign_now

Tap on SignTransactionButton
Looking for EnterPasswordInput

E selenium.common.exceptions.NoSuchElementException: Message: 'EnterPasswordInput' is not found on screen, using: 'xpath://android.widget.EditText[@NAF='true']'

Device sessions:

2. test_one_to_one_chat_messages_and_delete_chat

Wait for PlusButton
Looking for an element by text part: 'Test Name'

E Failed: Message with text "abc !@#$%%^&(() bold" was not received

Device sessions:

3. test_network_switch

Tap on ProfileButton
Looking for full text: 'RINKEBY WITH UPSTREAM RPC'

E selenium.common.exceptions.TimeoutException: Message: 'BaseElement' is not found on screen, using: 'xpath://*[@text="RINKEBY WITH UPSTREAM RPC"]', during '20' seconds

Device sessions:

4. test_group_chat_messages
E selenium.common.exceptions.WebDriverException: Message: The Sauce VMs failed to start the browser or device. For more info, please check https://wiki.saucelabs.com/display/DOCS/Common+Error+Messages

5. test_transaction_send_command_one_to_one_chat

Waiting 290 seconds for donation
Waiting 300 seconds for donation

E Failed: Donation was not received during 300 seconds!

Device sessions:

6. test_send_eth_to_request_in_group_chat

Tap on ContinueButtonAPK
Looking for OkButton

E selenium.common.exceptions.WebDriverException: Message: The test with session id 1742a1d69db542e7ab0cdfe578f32769 has already finished, and can't receive further commands. You can learn more at https://saucelabs.com/jobs/1742a1d69db542e7ab0cdfe578f32769 For help, please check https://wiki.saucelabs.com/display/DOCS/Common+Error+Messages

Device sessions:

7. test_transaction_send_command_group_chat

Waiting 290 seconds for donation
Waiting 300 seconds for donation

E Failed: Donation was not received during 300 seconds!

Device sessions:

Passed tests (9)

Click to expand
1. test_send_transaction_from_daap
Device sessions:

2. test_send_eth_to_request_from_wallet
Device sessions:

3. test_contact_profile_view
Device sessions:

4. test_public_chat
Device sessions:

5. test_browse_link_entering_url_in_dapp_view
Device sessions:

6. test_transaction_send_command_wrong_password
Device sessions:

7. test_send_eth_to_request_in_one_to_one_chat
Device sessions:

8. test_send_stt_from_wallet_via_enter_recipient_address
Device sessions:

9. test_send_eth_from_wallet_sign_later
Device sessions:

@rasom rasom force-pushed the bugfix/request-history-on-network-or-app-state-changes branch from d934a44 to 46fe7e6 Compare March 23, 2018 19:47
request history when network connection is reestablished
@rasom rasom force-pushed the bugfix/request-history-on-network-or-app-state-changes branch from 46fe7e6 to 239a21e Compare April 4, 2018 15:25
@rasom rasom closed this Apr 7, 2018
@rasom rasom deleted the bugfix/request-history-on-network-or-app-state-changes branch May 19, 2018 06:57
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.

Push notification is shown but no message received
6 participants