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

[#17823] Refactor tokens data app-db #17880

Merged
merged 5 commits into from
Nov 14, 2023

Conversation

ulisesmac
Copy link
Contributor

fixes #17823

Summary

This PR refactors app-db for the wallet data related to tokens and accounts. Full list of changes:

Refactor edit-account view and events:

  • Fix (fn []) code style.
  • Avoid overriding clojure.core/type by destructuring the :type key.
  • Split the toast callback to a different function.
  • :wallet/save-account receives :on-success instead of :callback to improve readability.

Refactor app-db for :wallet/tokens & :wallet/tokens-loading?

  • Remove the root sub :wallet/tokens-loading?, now it's in app-db in [:wallet :ui :tokens-loading?].
  • Remove the root subs :wallet/tokens, now the value is returned along with the account data by the sub
      :wallet/accounts, it's stored in app-db in [:wallet :address "0x..." :tokens].
  • Fix the format of the token data returned by the endpoint "wallet_getWalletToken" and the fn js->clj,
    • Addresses are no longer keywords (since keywords mustn't start with a number).
    • Keys are now kebab-case.
    • Chain-ids are no longer keywords, now they are integers.
  • Update tests

Move logic to calculate :wallet/balances and change value returned

  • Move logic to status-im2.contexts.wallet.common.utils
  • The :wallet/balances value returned by the sub had the following structure:
   [{:address "0x1...", :balance 12345}
    {:address "0x2...", :balance 67890} 
    ,,,]

  This required a helper function to get the balance for an address (get-balance-by-address)
  It has been changed to a map:

   {"0x1..." 12345
    "0x2..." 67890,
    ,,,}

 
  So now we don't need a helper function (just the hashmap itself or clojure.core/get).

  • Because of the previous change, now the get-balance-by-address has been removed.
  • The function get-account-by-address has zero uses, so it has been removed.
  • The test for the sub has been updated.

Create sub :wallet/account-cards-data

  • This sub returns a vector of maps to render the account cards in the wallet page.
  • This logic was previously in the view namespace, but it was completely calculated from the subs :wallet/accounts, :wallet/balances and :wallet/tokens-loading?, so it was clear that's a derived value.

Review notes

All points listed in the issue had been solved:

  • The tokens data are currently stored in the (root) key :wallet/tokens and it needs to be moved under the :wallet key (along with the accounts and other data). The :token key (under wallet) will be a map which will contain the data and loading? keys.
  • The keys inside the token data need to be renamed (kebab-case) and the helper methods should be placed in status-im2.common.data-store.wallet ns.
  • The subscriptions need to be updated to attach the token data for each account along with the account data.
  • The helper methods for the calculation of balances should be moved to status-im2.contexts.wallet.common.utils ns.
  • The usage should be updated across the wallet.

Platforms

  • Android
  • iOS

Areas that maybe impacted

  • Wallet account cards in the home screen
  • Wallet Edit account

status: ready

Comment on lines +116 to +122
add-tokens (fn [stored-accounts tokens-per-account]
(reduce-kv (fn [accounts address tokens-data]
(if (accounts address)
(update accounts address assoc :tokens tokens-data)
accounts))
stored-accounts
tokens-per-account))]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(merge-with merge accounts address) would do the job, but:
1 - It's less performant than just a reduce-kv
2 - If we receive tokens for a non-stored account, it'll lead to many UI bugs. Better only store tokens for a stored account.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part of the code transforms the token data in camel-case and fix keywords starting with a number

Comment on lines -85 to +100
:custom-subtitle (fn [] [quo/address-text
{:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}
{:network-name :arbitrum :short-name "arb1"}]
:address address
:format :long}])
:custom-subtitle (fn []
[quo/address-text
{:networks [{:network-name :ethereum :short-name "eth"}
{:network-name :optimism :short-name "opt"}
{:network-name :arbitrum :short-name "arb1"}]
:address address
:format :long}])
:on-press (fn []
(rf/dispatch [:show-bottom-sheet
{:content (fn [] [network-preferences/view
{:on-save #(js/alert
"calling on save")}])}]))
{:content (fn []
[network-preferences/view
{:on-save #(js/alert "calling on save")}])}]))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just style change on (fn[]), nothing important

Comment on lines -37 to +44
(save-account {:account account
:type :color
:value edited-color
:theme theme})))
(save-account {:account account
:updated-key :color
:new-value edited-color
:theme theme})))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We received :type and when destructuring it was overriding clojure.core/type, IMO it's clearer :updated-key according to the problem solved in this view.

Comment on lines -75 to +78
(fn [_ [{:keys [account callback]}]]
(fn [_ [{:keys [account on-success]}]]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

callback is too generic, actually, that callback is only executed when the rpc call was successful, so a better name is on-success

@status-im-auto
Copy link
Member

status-im-auto commented Nov 10, 2023

Jenkins Builds

Click to see older builds (4)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ e06f3fe #1 2023-11-10 22:57:58 ~5 min android 🤖apk 📲
✔️ e06f3fe #1 2023-11-10 22:58:28 ~6 min ios 📱ipa 📲
✔️ e06f3fe #1 2023-11-10 23:01:10 ~9 min android-e2e 🤖apk 📲
✔️ e06f3fe #1 2023-11-10 23:01:23 ~9 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d3ab631 #2 2023-11-14 08:48:14 ~6 min android-e2e 🤖apk 📲
✔️ d3ab631 #2 2023-11-14 08:48:58 ~7 min android 🤖apk 📲
✔️ d3ab631 #2 2023-11-14 08:50:48 ~8 min tests 📄log
✔️ d3ab631 #2 2023-11-14 08:50:54 ~9 min ios 📱ipa 📲
✔️ 5ca9c30 #3 2023-11-14 16:34:52 ~5 min android 🤖apk 📲
✔️ 5ca9c30 #3 2023-11-14 16:38:46 ~9 min android-e2e 🤖apk 📲
✔️ 5ca9c30 #3 2023-11-14 16:38:59 ~9 min tests 📄log
✔️ 5ca9c30 #3 2023-11-14 16:47:03 ~17 min ios 📱ipa 📲

Comment on lines +123 to +125
{:db (-> db
(update-in [:wallet :accounts] add-tokens tokens)
(assoc-in [:wallet :ui :tokens-loading?] false))})))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

tokens data are now inside accounts and the tokens-loading? is in a separate branch

Comment on lines +31 to +36
(rf/reg-sub
:wallet/account-cards-data
:<- [:wallet/accounts]
:<- [:wallet/balances]
:<- [:wallet/tokens-loading?]
(fn [[accounts balances tokens-loading?]]
Copy link
Contributor Author

@ulisesmac ulisesmac Nov 10, 2023

Choose a reason for hiding this comment

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

New sub to get account cards data, previously, it was calculated in the view

Comment on lines -41 to +29
(re-frame/reg-sub
(rf/reg-sub
:wallet/balances
:<- [:wallet/accounts]
:<- [:wallet/tokens]
(fn [[accounts tokens]]
(for [{:keys [address]} accounts]
{:address address
:balance (calculate-balance address tokens)})))
(fn [accounts]
(zipmap (map :address accounts)
(map #(-> % :tokens utils/calculate-balance) accounts))))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

balances is no longer a sequence of maps, now it's just a map. we no longer need a helper funciton, just extract the address from the map as any other regular key (i.e. (get balances "0x1.."))

Comment on lines -95 to +88
(is (= `({:address "0x1"
:balance 3250}
{:address "0x2"
:balance 2100})
(testing "a map: address->balance"
(swap! rf-db/app-db #(assoc-in % [:wallet :accounts] accounts))

(is (= {"0x1" 3250 "0x2" 2100}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Balances sub test updated

(is
(= `({:path "m/44'/60'/0'/0/0"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We were using ` instead of ' to quote lists. It's unnecessary, actually, if we try to add a var inside, (like I did for the :tokens key), we will need to also evaluate inside (using ~). So changed the backticks to just '

@vkjr
Copy link
Contributor

vkjr commented Nov 13, 2023

Great work! Thank you!

@@ -145,10 +145,6 @@
(reg-root-key-sub :communities/selected-tab :communities/selected-tab)
(reg-root-key-sub :contract-communities :contract-communities)

;;wallet
Copy link
Contributor

Choose a reason for hiding this comment

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

🙌

(map #(calculate-raw-balance (:raw-balance %) decimals))
(reduce +)))

(defn calculate-balance
Copy link
Member

Choose a reason for hiding this comment

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

Would be great to add unit tests for this function (also for every utils public function, but that can be done on a separate PR), wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 on this! Although I think we should do in a follow up - would be great to have this pr merged in asap as it will likely affect other prs but the changes brought in here are the right way to go 🚀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I'm trying to merge it ASAP.

And bout that function, it already existed in the code and it's being used by a subscription (:wallet/balances), that sub already has tests.

I refactored the implementation but it's still passing the tests, so it's already being tested in some way.

@ulisesmac
Copy link
Contributor Author

Note for QA

Please check the Areas that may be impacted in this PR description.
This PR should keep the app working as before in the areas menitoned. It's just about our code structure

@status-im-auto
Copy link
Member

71% of end-end tests have passed

Total executed tests: 45
Failed tests: 9
Expected to fail tests: 4
Passed tests: 32
IDs of failed tests: 702782,702733,702813,702745,703503,702936,702855,703391,702947 
IDs of expected to fail tests: 702732,702783,702731,702808 

Failed tests (9)

Click to expand
  • Rerun failed tests

  • Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936

    Device 2: Looking for a message by text: open community
    Device 2: Find `BaseElement` by `xpath`: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']`

    Test setup failed: activity_center/test_activity_center.py:248: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947

    Test setup failed: activity_center/test_activity_center.py:248: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Device 1: Find Button by accessibility id: communities-home-discover-card
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:40: in test_community_discovery
        self.home.community_card_item.wait_for_visibility_of_element(30)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: BaseElement by accessibility id:`community-card-item` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782

    Device 2: Find OpenInStatusButton by xpath: //*[@text="Open in Status"]
    Device 2: Tap on found: OpenInStatusButton

    critical/chats/test_1_1_public_chats.py:176: in test_1_1_chat_emoji_send_reply_and_open_link
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message with emoji was not sent or received in 1-1 chat
    



    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    critical/chats/test_1_1_public_chats.py:459: in test_1_1_chat_text_message_delete_push_disappear
        if not self.chat_1.chat_message_input.is_element_displayed():
    ../views/base_element.py:212: in is_element_displayed
        return self.wait_for_visibility_of_element(sec, ignored_exceptions=ignored_exceptions)
    ../views/base_element.py:137: in wait_for_visibility_of_element
        .until(expected_conditions.visibility_of_element_located((self.by, self.locator)))
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py:86: in until
        value = method(self._driver)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/expected_conditions.py:152: in _predicate
        return _element_if_visible(driver.find_element(*locator))
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/webdriver.py:409: in find_element
        return self.execute(RemoteCommand.FIND_ELEMENT, {'using': by, 'value': value})['value']
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     A session is either terminated or not started
    E   Stacktrace:
    E   NoSuchDriverError: A session is either terminated or not started
    E       at asyncHandler (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:315:15)
    E       at /mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:518:15
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:144:13)
    E       at Route.dispatch (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:114:3)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:284:15
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:365:14)
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:376:14)
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:421:3)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at logger (/mnt/sauce/appium/appium-v2.0.0/node_modules/morgan/index.js:144:5)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at trim_prefix (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:328:13)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:286:9
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:346:12)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/body-parser/lib/read.js:137:5
    E       at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
    E       at invokeCallback (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:238:16)
    E       at done (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:227:7)
    E       at IncomingMessage.onEnd (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:287:7)
    E       at IncomingMessage.emit (node:events:513:28)
    E       at endReadableNT (node:internal/streams/readable:1359:12)
    E       at processTicksAndRejections (node:internal/process/task_queues:82:21)
    



    Device sessions

    3. test_1_1_chat_push_emoji, id: 702813

    critical/chats/test_1_1_public_chats.py:320: in test_1_1_chat_push_emoji
        [home.navigate_back_to_home_view() for home in self.homes]
    critical/chats/test_1_1_public_chats.py:320: in <listcomp>
        [home.navigate_back_to_home_view() for home in self.homes]
    ../views/base_view.py:396: in navigate_back_to_home_view
        while not self.chat_floating_screen.is_element_disappeared(1) \
    ../views/base_element.py:222: in is_element_disappeared
        return self.wait_for_invisibility_of_element(sec)
    ../views/base_element.py:146: in wait_for_invisibility_of_element
        .until(expected_conditions.invisibility_of_element_located((self.by, self.locator)))
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py:86: in until
        value = method(self._driver)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/expected_conditions.py:319: in _predicate
        target = driver.find_element(*target)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/webdriver.py:409: in find_element
        return self.execute(RemoteCommand.FIND_ELEMENT, {'using': by, 'value': value})['value']
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     A session is either terminated or not started
    E   Stacktrace:
    E   NoSuchDriverError: A session is either terminated or not started
    E       at asyncHandler (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:315:15)
    E       at /mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:518:15
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:144:13)
    E       at Route.dispatch (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:114:3)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:284:15
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:365:14)
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:376:14)
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:421:3)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at logger (/mnt/sauce/appium/appium-v2.0.0/node_modules/morgan/index.js:144:5)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at trim_prefix (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:328:13)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:286:9
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:346:12)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/body-parser/lib/read.js:137:5
    E       at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
    E       at invokeCallback (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:238:16)
    E       at done (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:227:7)
    E       at IncomingMessage.onEnd (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:287:7)
    E       at IncomingMessage.emit (node:events:513:28)
    E       at endReadableNT (node:internal/streams/readable:1359:12)
    E       at processTicksAndRejections (node:internal/process/task_queues:82:21)
    



    Device sessions

    4. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 2: Tap on found: SendMessageButton
    Device 1: Looking for a message by text: hello

    critical/chats/test_1_1_public_chats.py:286: in test_1_1_chat_non_latin_messages_stack_update_profile_photo
        if not self.chat_1.chat_element_by_text(message).is_element_displayed(10):
    ../views/base_element.py:212: in is_element_displayed
        return self.wait_for_visibility_of_element(sec, ignored_exceptions=ignored_exceptions)
    ../views/base_element.py:137: in wait_for_visibility_of_element
        .until(expected_conditions.visibility_of_element_located((self.by, self.locator)))
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py:86: in until
        value = method(self._driver)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/expected_conditions.py:152: in _predicate
        return _element_if_visible(driver.find_element(*locator))
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/webdriver.py:409: in find_element
        return self.execute(RemoteCommand.FIND_ELEMENT, {'using': by, 'value': value})['value']
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     A session is either terminated or not started
    E   Stacktrace:
    E   NoSuchDriverError: A session is either terminated or not started
    E       at asyncHandler (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:315:15)
    E       at /mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:518:15
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:144:13)
    E       at Route.dispatch (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:114:3)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:284:15
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:365:14)
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:376:14)
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:421:3)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at logger (/mnt/sauce/appium/appium-v2.0.0/node_modules/morgan/index.js:144:5)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at trim_prefix (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:328:13)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:286:9
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:346:12)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/body-parser/lib/read.js:137:5
    E       at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
    E       at invokeCallback (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:238:16)
    E       at done (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:227:7)
    E       at IncomingMessage.onEnd (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:287:7)
    E       at IncomingMessage.emit (node:events:513:28)
    E       at endReadableNT (node:internal/streams/readable:1359:12)
    E       at processTicksAndRejections (node:internal/process/task_queues:82:21)
    



    Device sessions

    5. test_1_1_chat_edit_message, id: 702855

    critical/chats/test_1_1_public_chats.py:370: in test_1_1_chat_edit_message
        [home.navigate_back_to_home_view() for home in self.homes]
    critical/chats/test_1_1_public_chats.py:370: in <listcomp>
        [home.navigate_back_to_home_view() for home in self.homes]
    ../views/base_view.py:396: in navigate_back_to_home_view
        while not self.chat_floating_screen.is_element_disappeared(1) \
    ../views/base_element.py:222: in is_element_disappeared
        return self.wait_for_invisibility_of_element(sec)
    ../views/base_element.py:146: in wait_for_invisibility_of_element
        .until(expected_conditions.invisibility_of_element_located((self.by, self.locator)))
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py:86: in until
        value = method(self._driver)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/expected_conditions.py:319: in _predicate
        target = driver.find_element(*target)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/webdriver.py:409: in find_element
        return self.execute(RemoteCommand.FIND_ELEMENT, {'using': by, 'value': value})['value']
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     A session is either terminated or not started
    E   Stacktrace:
    E   NoSuchDriverError: A session is either terminated or not started
    E       at asyncHandler (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:315:15)
    E       at /mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:518:15
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:144:13)
    E       at Route.dispatch (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:114:3)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:284:15
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:365:14)
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:376:14)
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:421:3)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at logger (/mnt/sauce/appium/appium-v2.0.0/node_modules/morgan/index.js:144:5)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at trim_prefix (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:328:13)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:286:9
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:346:12)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/body-parser/lib/read.js:137:5
    E       at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
    E       at invokeCallback (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:238:16)
    E       at done (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:227:7)
    E       at IncomingMessage.onEnd (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:287:7)
    E       at IncomingMessage.emit (node:events:513:28)
    E       at endReadableNT (node:internal/streams/readable:1359:12)
    E       at processTicksAndRejections (node:internal/process/task_queues:82:21)
    



    Device sessions

    6. test_1_1_chat_send_image_save_and_share, id: 703391

    critical/chats/test_1_1_public_chats.py:398: in test_1_1_chat_send_image_save_and_share
        if not self.chat_1.chat_message_input.is_element_displayed():
    ../views/base_element.py:212: in is_element_displayed
        return self.wait_for_visibility_of_element(sec, ignored_exceptions=ignored_exceptions)
    ../views/base_element.py:137: in wait_for_visibility_of_element
        .until(expected_conditions.visibility_of_element_located((self.by, self.locator)))
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/wait.py:86: in until
        value = method(self._driver)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/support/expected_conditions.py:152: in _predicate
        return _element_if_visible(driver.find_element(*locator))
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/webdriver.py:409: in find_element
        return self.execute(RemoteCommand.FIND_ELEMENT, {'using': by, 'value': value})['value']
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     A session is either terminated or not started
    E   Stacktrace:
    E   NoSuchDriverError: A session is either terminated or not started
    E       at asyncHandler (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:315:15)
    E       at /mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/protocol/protocol.js:518:15
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:144:13)
    E       at Route.dispatch (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/route.js:114:3)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:284:15
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:365:14)
    E       at param (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:376:14)
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:421:3)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at logger (/mnt/sauce/appium/appium-v2.0.0/node_modules/morgan/index.js:144:5)
    E       at Layer.handle [as handle_request] (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/layer.js:95:5)
    E       at trim_prefix (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:328:13)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:286:9
    E       at Function.process_params (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:346:12)
    E       at next (/mnt/sauce/appium/appium-v2.0.0/node_modules/express/lib/router/index.js:280:10)
    E       at /mnt/sauce/appium/appium-v2.0.0/node_modules/body-parser/lib/read.js:137:5
    E       at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
    E       at invokeCallback (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:238:16)
    E       at done (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:227:7)
    E       at IncomingMessage.onEnd (/mnt/sauce/appium/appium-v2.0.0/node_modules/raw-body/index.js:287:7)
    E       at IncomingMessage.emit (node:events:513:28)
    E       at endReadableNT (node:internal/streams/readable:1359:12)
    E       at processTicksAndRejections (node:internal/process/task_queues:82:21)
    



    Device sessions

    Expected to fail tests (4)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    2. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:323: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline 
    

    [[Data delivery issue]]

    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    Device 2: Find Text by xpath: //*[starts-with(@text,'test message')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView
    Device 2: Text is Sent

    critical/chats/test_1_1_public_chats.py:619: in test_1_1_chat_is_shown_message_sent_delivered_from_offline
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message status was not changed to Delivered, it's Sent after back up online! 
    

    [[Data delivery issue]]

    Device sessions

    Passed tests (32)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495
    Device sessions

    2. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    3. test_group_chat_reactions, id: 703202
    Device sessions

    4. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    3. test_community_undo_delete_message, id: 702869
    Device sessions

    4. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    5. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_add_contact_field_validation, id: 702777
    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    3. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_leave, id: 702845
    Device sessions

    5. test_community_join_when_node_owner_offline, id: 703629
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_one_image_send_reply, id: 702859
    Device sessions

    3. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    4. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    5. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    6. test_community_message_delete, id: 702839
    Device sessions

    7. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    8. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    9. test_community_message_edit, id: 702843
    Device sessions

    10. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    @pavloburykh pavloburykh force-pushed the 17823/refactor-tokens-data-app-db branch from e06f3fe to d3ab631 Compare November 14, 2023 08:41
    @status-im-auto
    Copy link
    Member

    64% of end-end tests have passed

    Total executed tests: 45
    Failed tests: 13
    Expected to fail tests: 3
    Passed tests: 29
    
    IDs of failed tests: 702855,702947,702786,702745,702733,702809,703629,703133,702869,702782,703503,703297,702936 
    
    IDs of expected to fail tests: 702731,702808,702732 
    

    Failed tests (13)

    Click to expand
  • Rerun failed tests

  • Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Test setup failed: activity_center/test_activity_center.py:248: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    2. test_navigation_jump_to, id: 702936

    Device 2: Looking for a message by text: open community
    Device 2: Find BaseElement by xpath: //*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']

    Test setup failed: activity_center/test_activity_center.py:248: in prepare_devices
        self.chat_2.chat_element_by_text(self.community_name).view_community_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: BaseElement by xpath: `//*[starts-with(@text,'open community')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@text='View']` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_edit_message, id: 702855

    Device 2: Find Text by xpath: //*[starts-with(@text,'Message before edit 1-1')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']
    Device 2: Tap on found: Text

    critical/chats/test_1_1_public_chats.py:380: in test_1_1_chat_edit_message
        self.chat_2.chat_element_by_text(message_before_edit_1_1).wait_for_status_to_be("Delivered")
    ../views/chat_view.py:240: in wait_for_status_to_be
        raise TimeoutException("Message status was not changed to %s, it's %s" % (expected_status, current_status))
     Message status was not changed to Delivered, it's; 
     RemoteDisconnected
    



    Device sessions

    2. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 2: Looking for a message by text: hello
    Device 2: Find TimeStampText by xpath: //*[starts-with(@text,'hello')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-timestamp']

    critical/chats/test_1_1_public_chats.py:296: in test_1_1_chat_non_latin_messages_stack_update_profile_photo
        'Timestamp on message %s does not correspond expected [%s]' % (timestamp, *sent_time_variants))
     not all arguments converted during string formatting
    



    Device sessions

    3. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    Device 2: Tap on found: Text
    Device 2: Find Text by xpath: //*[starts-with(@text,'smth I should edit')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']

    critical/chats/test_1_1_public_chats.py:468: in test_1_1_chat_text_message_delete_push_disappear
        self.chat_2.chat_element_by_text(message_after_edit_1_1).wait_for_status_to_be("Delivered")
    ../views/chat_view.py:236: in wait_for_status_to_be
        current_status = self.status
    ../views/chat_view.py:224: in status
        Text(self.driver, xpath=self.locator).click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py:94: in click
        self._execute(Command.CLICK_ELEMENT)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py:395: in _execute
        return self._parent.execute(command, params)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /home/jenkins/.local/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     error processing request. If this error persists, please contact SauceLabs support.; 
     RemoteDisconnected
    



    Device sessions

    4. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782

    Device 2: Find OpenInStatusButton by xpath: //*[@text="Open in Status"]
    Device 2: Tap on found: OpenInStatusButton

    critical/chats/test_1_1_public_chats.py:176: in test_1_1_chat_emoji_send_reply_and_open_link
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message with emoji was not sent or received in 1-1 chat
    



    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    # STEP: Check that removed user is not shown in the list anymore
    Device 1: Find Button by accessibility id: show-profiles

    critical/chats/test_public_chat_browsing.py:270: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.sign_in.show_profiles_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `show-profiles` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    2. test_community_undo_delete_message, id: 702869

    Device 1: Tap on found: Button
    Device 1: Looking for a message by text: message to delete and undo

    critical/chats/test_public_chat_browsing.py:110: in test_community_undo_delete_message
        self.channel.chat_element_by_text(message_to_delete).wait_for_visibility_of_element()
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatElementByText by xpath:`//*[starts-with(@text,'message to delete and undo')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element
    
    During handling of the above exception, another exception occurred:
    critical/chats/test_public_chat_browsing.py:112: in test_community_undo_delete_message
        pytest.fail("Message was not restored by clicking 'Undo' button")
    E   Failed: Message was not restored by clicking 'Undo' button
    



    Device sessions

    3. test_community_discovery, id: 703503

    Device 1: Find Button by accessibility id: communities-home-discover-card
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:40: in test_community_discovery
        self.home.community_card_item.wait_for_visibility_of_element(30)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: BaseElement by accessibility id:`community-card-item` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_mentions_push_notification, id: 702786

    # STEP: Invited member sends a message with a mention
    Device 2: Sending message 'hi'

    critical/chats/test_public_chat_browsing.py:821: in test_community_mentions_push_notification
        self.channel_2.send_message("hi")
    ../views/chat_view.py:1003: in send_message
        self.chat_message_input.wait_for_element(wait_chat_input_sec)
    ../views/base_element.py:121: in wait_for_element
        raise TimeoutException(
     Device `2`: `ChatMessageInput` by` accessibility id`: `chat-message-input` is not found on the screen after wait_for_element
    



    Device sessions

    2. test_community_markdown_support, id: 702809

    # STEP: Checking that "bold text in asterics" is applied (**) in community channel
    Device 2: Sending message 'bold text in asterics'

    critical/chats/test_public_chat_browsing.py:925: in test_community_markdown_support
        self.channel_2.send_message(message_to_send)
    ../views/chat_view.py:1003: in send_message
        self.chat_message_input.wait_for_element(wait_chat_input_sec)
    ../views/base_element.py:121: in wait_for_element
        raise TimeoutException(
     Device `2`: `ChatMessageInput` by` accessibility id`: `chat-message-input` is not found on the screen after wait_for_element
    



    Device sessions

    3. test_community_join_when_node_owner_offline, id: 703629

    Device 2: Looking for community: 'open community'
    Device 2: Click until Text by accessibility id: community-description-text will be presented

    critical/chats/test_public_chat_browsing.py:1113: in test_community_join_when_node_owner_offline
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Text "You joined “closed community”" in shown toast element doesn't match expected "You joined “open community”"
    E    Joined status is not displayed
    



    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_send_image_save_and_share, id: 703297

    Device 1: Looking for a message by text: test image
    Device 1: Trying to access image inside message with text 'test image'

    critical/chats/test_group_chat.py:225: in test_group_chat_send_image_save_and_share
        image_description).image_in_message.is_element_image_similar_to_template('saucelabs_sauce_chat.png'):
    ../views/base_element.py:280: in is_element_image_similar_to_template
        template = imagehash.average_hash(Image.open(image_template))
    /home/jenkins/.local/lib/python3.10/site-packages/PIL/Image.py:2958: in open
     cannot identify image file '/home/jenkins/workspace/status-mobile/e2e/status-app-prs/test/appium/views/elements_templates/saucelabs_sauce_chat.png'
    



    Device sessions

    Expected to fail tests (3)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:323: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline 
    

    [[Data delivery issue]]

    Device sessions

    2. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Passed tests (29)

    Click to expand

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    3. test_add_contact_field_validation, id: 702777
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    2. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    3. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    3. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_leave, id: 702845
    Device sessions

    2. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_reactions, id: 703202
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_mute_chat, id: 703495
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    3. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    4. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    5. test_community_unread_messages_badge, id: 702841
    Device sessions

    6. test_community_message_delete, id: 702839
    Device sessions

    7. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    8. test_community_one_image_send_reply, id: 702859
    Device sessions

    9. test_community_message_edit, id: 702843
    Device sessions

    10. test_community_several_images_send_reply, id: 703194
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    @VolodLytvynenko VolodLytvynenko self-assigned this Nov 14, 2023
    @status-im-auto
    Copy link
    Member

    80% of end-end tests have passed

    Total executed tests: 45
    Failed tests: 6
    Expected to fail tests: 3
    Passed tests: 36
    
    IDs of failed tests: 702733,703133,702745,703503,702855,703629 
    
    IDs of expected to fail tests: 702732,702731,702808 
    

    Failed tests (6)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    # STEP: Check that can login with different user
    Device 1: Find `Button` by `accessibility id`: `show-profiles`

    critical/chats/test_public_chat_browsing.py:251: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.sign_in.show_profiles_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `show-profiles` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    2. test_community_discovery, id: 703503

    Device 1: Find Button by accessibility id: communities-home-discover-card
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:40: in test_community_discovery
        self.home.community_card_item.wait_for_visibility_of_element(30)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: BaseElement by accessibility id:`community-card-item` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_join_when_node_owner_offline, id: 703629

    Device 2: Tap on found: Button
    Device 2: Looking for community: 'open community'

    critical/chats/test_public_chat_browsing.py:1113: in test_community_join_when_node_owner_offline
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Joined status is not displayed
    E    open community is not listed inside Joined communities tab
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    Device 2: Find Text by xpath: //*[starts-with(@text,'smth I should edit')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']
    Device 2: Tap on found: Text

    critical/chats/test_1_1_public_chats.py:468: in test_1_1_chat_text_message_delete_push_disappear
        self.chat_2.chat_element_by_text(message_after_edit_1_1).wait_for_status_to_be("Delivered")
    ../views/chat_view.py:240: in wait_for_status_to_be
        raise TimeoutException("Message status was not changed to %s, it's %s" % (expected_status, current_status))
     Message status was not changed to Delivered, it's; 
     RemoteDisconnected
    



    Device sessions

    2. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 2: Looking for a message by text: hello
    Device 2: Find TimeStampText by xpath: //*[starts-with(@text,'hello')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-timestamp']

    critical/chats/test_1_1_public_chats.py:296: in test_1_1_chat_non_latin_messages_stack_update_profile_photo
        'Timestamp on message %s does not correspond expected [%s]' % (timestamp, *sent_time_variants))
     not all arguments converted during string formatting
    



    Device sessions

    3. test_1_1_chat_edit_message, id: 702855

    Device 2: Find Text by xpath: //*[starts-with(@text,'Message before edit 1-1')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']
    Device 2: Tap on found: Text

    critical/chats/test_1_1_public_chats.py:380: in test_1_1_chat_edit_message
        self.chat_2.chat_element_by_text(message_before_edit_1_1).wait_for_status_to_be("Delivered")
    ../views/chat_view.py:240: in wait_for_status_to_be
        raise TimeoutException("Message status was not changed to %s, it's %s" % (expected_status, current_status))
     Message status was not changed to Delivered, it's; 
     RemoteDisconnected
    



    Device sessions

    Expected to fail tests (3)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    2. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:323: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline 
    

    [[Data delivery issue]]

    Device sessions

    Passed tests (36)

    Click to expand

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_one_image_send_reply, id: 702859
    Device sessions

    3. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    4. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    5. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    6. test_community_message_delete, id: 702839
    Device sessions

    7. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    8. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    9. test_community_message_edit, id: 702843
    Device sessions

    10. test_community_unread_messages_badge, id: 702841
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495
    Device sessions

    2. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    3. test_group_chat_reactions, id: 703202
    Device sessions

    4. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_markdown_support, id: 702809
    Device sessions

    2. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_leave, id: 702845
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    3. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_community_undo_delete_message, id: 702869
    Device sessions

    3. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    4. test_community_mute_community_and_channel, id: 703382
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_add_contact_field_validation, id: 702777
    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    3. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_mentions, id: 702957
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    @VolodLytvynenko
    Copy link
    Contributor

    Hi @ulisesmac thank you for your work. No issues from my side. PR is ready to be merged

     - Fix `(fn [])` code style.
     - Avoid overriding clojure.core/type by destructuring the `:type` key.
     - Split the toast callback to a different function.
     - `:wallet/save-account` receives `:on-success` instead of `:callback` to improve readability.
    - Remove the root sub `:wallet/tokens-loading?`, now it's in app-db in `[:wallet :ui :tokens-loading?]`.
    - Remove the root subs `:wallet/tokens`, now the value is returned along with the account data by the sub
      `:wallet/accounts`, it's stored in app-db in `[:wallet :address "0x..." :tokens]`.
    - Fix the format of the token data returned by the endpoint `"wallet_getWalletToken"` and the fn `js->clj`,
        - Addresses are no longer keywords (since keywords mustn't start with a number).
        - Keys are now kebab-case.
        - Chain-ids are no longer keywords, now they are integers.
    - Update tests.
    - Move logic to `status-im2.contexts.wallet.common.utils`
    - The `:wallet/balances` value returned by the sub had the following structure:
      [{:address "0x1...", :balance 12345}
       {:address "0x2...", :balance 67890} ...]
      This required a helper function to get the balance for an address (`get-balance-by-address`)
      It has been changed to a map:
      {"0x1..." 12345
       "0x2..." 67890, ...}
      So now we don't need a helper function (just the hashmap itself or `clojure.core/get`).
    - Because of the previous change, now the `get-balance-by-address` has been removed.
    - The function `get-account-by-address` has zero uses, so it has been removed.
    - The test for the sub has been updated.
    This sub returns a vector of maps to render the account cards in the wallet page.
    This logic was previously in the `view` namespace, but it was completely calculated from
    the subs `:wallet/accounts`, `:wallet/balances` and `:wallet/tokens-loading?`, so it was
    clear that's a derived value.
    @ulisesmac ulisesmac force-pushed the 17823/refactor-tokens-data-app-db branch from d3ab631 to 5ca9c30 Compare November 14, 2023 16:28
    @ulisesmac ulisesmac merged commit 45df308 into develop Nov 14, 2023
    6 checks passed
    @ulisesmac ulisesmac deleted the 17823/refactor-tokens-data-app-db branch November 14, 2023 16:54
    @status-im-auto
    Copy link
    Member

    87% of end-end tests have passed

    Total executed tests: 45
    Failed tests: 3
    Expected to fail tests: 3
    Passed tests: 39
    
    IDs of failed tests: 702733,703503,703133 
    
    IDs of expected to fail tests: 702732,702808,702731 
    

    Failed tests (3)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Device 1: Find `Button` by `accessibility id`: `communities-home-discover-card`
    Device 1: Tap on found: Button

    critical/chats/test_public_chat_browsing.py:40: in test_community_discovery
        self.home.community_card_item.wait_for_visibility_of_element(30)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: BaseElement by accessibility id:`community-card-item` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    # STEP: Check that can login with different user
    Device 1: Find Button by accessibility id: show-profiles

    critical/chats/test_public_chat_browsing.py:251: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.sign_in.show_profiles_button.click()
    ../views/base_element.py:90: in click
        self.find_element().click()
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `show-profiles` is not found on the screen; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733

    Device 2: Tap on found: Text
    Device 2: Find Text by xpath: //*[starts-with(@text,'message to delete for me')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView

    critical/chats/test_1_1_public_chats.py:480: in test_1_1_chat_text_message_delete_push_disappear
        self.chat_2.chat_element_by_text(message_to_delete_for_me).wait_for_status_to_be("Delivered", timeout)
    ../views/chat_view.py:236: in wait_for_status_to_be
        current_status = self.status
    ../views/chat_view.py:226: in status
        status = status_element.text
    ../views/base_element.py:406: in text
        text = self.find_element().text
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py:90: in text
        return self._execute(Command.GET_ELEMENT_TEXT)["value"]
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webelement.py:395: in _execute
        return self._parent.execute(command, params)
    /home/jenkins/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    /usr/local/lib/python3.10/dist-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     The element 'By.xpath: //*[starts-with(@text,'message to delete for me')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView' does not exist in DOM anymore; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#stale-element-reference-exception
    E   Stacktrace:
    E   io.appium.uiautomator2.common.exceptions.StaleElementReferenceException: The element 'By.xpath: //*[starts-with(@text,'message to delete for me')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='message-status']/android.widget.TextView' does not exist in DOM anymore
    E   	at io.appium.uiautomator2.model.ElementsCache.restore(ElementsCache.java:117)
    E   	at io.appium.uiautomator2.model.ElementsCache.get(ElementsCache.java:153)
    E   	at io.appium.uiautomator2.handler.GetText.safeHandle(GetText.java:20)
    E   	at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:277)
    E   	at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:271)
    E   	at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    E   	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    E   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    E   	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    E   	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    E   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    E   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    E   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
    E   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
    E   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    E   	at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    E   	at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    E   	at java.lang.Thread.run(Thread.java:919)
    



    Device sessions

    Expected to fail tests (3)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Pin feature is in development]]

    2. test_group_chat_offline_pn, id: 702808

    Device 3: Looking for a message by text: message from old member
    Device 3: Looking for a message by text: message from new member

    critical/chats/test_group_chat.py:323: in test_group_chat_offline_pn
        self.errors.verify_no_errors()
    base_test_case.py:191: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Messages PN was not fetched from offline 
    

    [[Data delivery issue]]

    Device sessions

    Passed tests (39)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    2. test_group_chat_mute_chat, id: 703495
    Device sessions

    3. test_group_chat_reactions, id: 703202
    Device sessions

    4. test_group_chat_send_image_save_and_share, id: 703297
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936
    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    2. test_add_contact_field_validation, id: 702777
    Device sessions

    3. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    Class TestCommunityMultipleDeviceMergedTwo:

    1. test_community_mentions_push_notification, id: 702786
    Device sessions

    2. test_community_join_when_node_owner_offline, id: 703629
    Device sessions

    3. test_community_hashtag_links_to_community_channels, id: 702948
    Device sessions

    4. test_community_markdown_support, id: 702809
    Device sessions

    5. test_community_leave, id: 702845
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:

    1. test_1_1_chat_mute_chat, id: 703496
    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    3. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    Class TestActivityMultipleDevicePRTwo:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_community_mute_community_and_channel, id: 703382
    Device sessions

    3. test_community_undo_delete_message, id: 702869
    Device sessions

    4. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    2. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    3. test_community_one_image_send_reply, id: 702859
    Device sessions

    4. test_community_message_edit, id: 702843
    Device sessions

    5. test_community_several_images_send_reply, id: 703194
    Device sessions

    6. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    9. test_community_unread_messages_badge, id: 702841
    Device sessions

    10. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    3. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    5. test_1_1_chat_edit_message, id: 702855
    Device sessions

    6. test_1_1_chat_send_image_save_and_share, id: 703391
    Device sessions

    yevh-berdnyk pushed a commit that referenced this pull request Dec 8, 2023
    * Refactor edit-account view and events:
    
     - Fix `(fn [])` code style.
     - Avoid overriding clojure.core/type by destructuring the `:type` key.
     - Split the toast callback to a different function.
     - `:wallet/save-account` receives `:on-success` instead of `:callback` to improve readability.
    
    * Refactor app-db for `:wallet/tokens` & `:wallet/tokens-loading?`
    
    - Remove the root sub `:wallet/tokens-loading?`, now it's in app-db in `[:wallet :ui :tokens-loading?]`.
    - Remove the root subs `:wallet/tokens`, now the value is returned along with the account data by the sub
      `:wallet/accounts`, it's stored in app-db in `[:wallet :address "0x..." :tokens]`.
    - Fix the format of the token data returned by the endpoint `"wallet_getWalletToken"` and the fn `js->clj`,
        - Addresses are no longer keywords (since keywords mustn't start with a number).
        - Keys are now kebab-case.
        - Chain-ids are no longer keywords, now they are integers.
    - Update tests.
    
    * Move logic to calculate `:wallet/balances` and change value returned
    
    - Move logic to `status-im2.contexts.wallet.common.utils`
    - The `:wallet/balances` value returned by the sub had the following structure:
      [{:address "0x1...", :balance 12345}
       {:address "0x2...", :balance 67890} ...]
      This required a helper function to get the balance for an address (`get-balance-by-address`)
      It has been changed to a map:
      {"0x1..." 12345
       "0x2..." 67890, ...}
      So now we don't need a helper function (just the hashmap itself or `clojure.core/get`).
    - Because of the previous change, now the `get-balance-by-address` has been removed.
    - The function `get-account-by-address` has zero uses, so it has been removed.
    - The test for the sub has been updated.
    
    * Create sub `:wallet/account-cards-data`
    
    This sub returns a vector of maps to render the account cards in the wallet page.
    This logic was previously in the `view` namespace, but it was completely calculated from
    the subs `:wallet/accounts`, `:wallet/balances` and `:wallet/tokens-loading?`, so it was
    clear that's a derived value.
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Refactor wallet tokens data in app-db
    7 participants