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

[#21270] - Collectibles stuck in loading for watch only accounts #21286

Merged
merged 2 commits into from
Sep 24, 2024

Conversation

ulisesmac
Copy link
Contributor

fixes #21270

Summary

This PR fixes the exception thrown on Android when a loading collectible is pressed.

⚠️ ATM I can't test on iOS, I really appreaciate QA help testing that the loading state and collectible behavior hasn't changed on iOS ⚠️

⚠️ Important note

Although this PR solves the exception, the root issue (collectibles are stuck in a loading state) happen sometimes.

It was reported in:

And we tried to solve it in:

But it's still reproducible (waited for more than a minute, and actually after 15mins they never loaded):

Screencast.from.2024-09-18.19-17-40.mp4

What is this PR doing then?

This PR:
✅ Fixes the loading collectible state on Android (it only worked on iOS)
✅ When the user presses a loading collectible, it won't throw any error/exception.

Review notes

I'll reopen the root issue.

Platforms

  • Android
  • iOS

Steps to test

[Android]

  • Open Status in a fresh install
  • Create a new Status profile
  • Disable test networks (if they were enabled)
  • Add a watched address, you can pick any of the addresses listed in this issue, e.g. 0x00000000219ab540356cbb839cbe05303d7705fa
  • Switch to the collectibles tab
  • If they are stuck in a loading state, you can press them and no exception will be thrown.

[iOS]

  • Make sure the collectibles are still stuck in a loading state and nothing is broken (pressing, opening a collectible, scrolling).

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Sep 19, 2024

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 16b7726 #1 2024-09-19 01:42:20 ~4 min tests 📄log
✔️ 16b7726 #1 2024-09-19 01:45:31 ~7 min android-e2e 🤖apk 📲
✔️ 16b7726 #1 2024-09-19 01:45:57 ~8 min android 🤖apk 📲
✔️ 16b7726 #1 2024-09-19 01:48:07 ~10 min ios 📱ipa 📲
✔️ 7ee38b0 #2 2024-09-20 12:33:33 ~4 min tests 📄log
✔️ 7ee38b0 #2 2024-09-20 12:37:30 ~8 min android-e2e 🤖apk 📲
✔️ 7ee38b0 #2 2024-09-20 12:37:31 ~8 min android 🤖apk 📲
✔️ 7ee38b0 #2 2024-09-20 12:43:22 ~14 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 90aaf52 #3 2024-09-24 01:29:15 ~4 min tests 📄log
✔️ 90aaf52 #3 2024-09-24 01:30:52 ~6 min android-e2e 🤖apk 📲
✔️ 90aaf52 #3 2024-09-24 01:32:29 ~7 min android 🤖apk 📲
✔️ 90aaf52 #3 2024-09-24 01:34:29 ~9 min ios 📱ipa 📲
✔️ ad74b1c #4 2024-09-24 22:10:47 ~4 min tests 📄log
✔️ ad74b1c #4 2024-09-24 22:13:11 ~6 min android 🤖apk 📲
✔️ ad74b1c #4 2024-09-24 22:13:44 ~7 min android-e2e 🤖apk 📲
✔️ ad74b1c #4 2024-09-24 22:15:59 ~9 min ios 📱ipa 📲

Copy link
Contributor Author

@ulisesmac ulisesmac left a comment

Choose a reason for hiding this comment

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

Although this PR is fixing the loading? logic, I'm not too happy with the solution.

The loading? property previously added seems not reactive (i.e. if it's true when the component is mounted and then switched to false, it'll be ignored). Although it works because we are re-mounting the listing, seems not clean.

IMO, the property could have been named :always-loading? to clearly show its purpose.

Now with the changes, the loading? property is being checked during the calculation of the component, but we are still remounting the listing to switch from "collectibles loading" -> "loaded collectibles".

Copy link
Member

@smohamedjavid smohamedjavid left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this @ulisesmac 🙌

IMO, the property could have been named :always-loading? to clearly show its purpose.

I have no strong opinion on this. The component is supposed to have a prop status with values accepted as default or loading. However, the component handles the loading state due to the image fetching. Hence, the loading? prop is introduced to be controllable from the parent without many changes in the component (I don't want to break the component, as it's essential to handle the image loading time). I'm fine with any name 👍 .

@status-im-auto
Copy link
Member

71% of end-end tests have passed

Total executed tests: 7
Failed tests: 2
Expected to fail tests: 0
Passed tests: 5
IDs of failed tests: 702745,727229 

Failed tests (2)

Click to expand
  • Rerun failed tests

  • Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745

    Device 2: Tap on found: Button
    Device 2: Find `Text` by `xpath`: `//*[@resource-id='android:id/content_preview_text']`

    Test setup failed: critical/chats/test_1_1_public_chats.py:31: in prepare_devices
        self.public_key_2 = self.home_2.get_public_key()
    ../views/home_view.py:590: in get_public_key
        link_to_profile = self.get_link_to_profile()
    ../views/home_view.py:584: in get_link_to_profile
        link_to_profile = self.sharing_text_native.text
    ../views/base_element.py:419: in text
        text = self.find_element().text
    ../views/base_element.py:84: in find_element
        raise exception
    ../views/base_element.py:77: in find_element
        return self.driver.find_element(self.by, self.locator)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/appium/webdriver/webdriver.py:409: in find_element
        return self.execute(RemoteCommand.FIND_ELEMENT, {'using': by, 'value': value})['value']
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    ../../../../status-app-prs-rerun@tmp/venv/lib/python3.10/site-packages/appium/webdriver/errorhandler.py:122: in check_response
        raise exception_class(msg=message, stacktrace=format_stacktrace(stacktrace))
     An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
    E   Stacktrace:
    E   UnknownError: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
    E       at UIA2Proxy.command (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/jsonwp-proxy/proxy.js:355:13)
    E       at processTicksAndRejections (node:internal/process/task_queues:95:5)
    E       at AndroidUiautomator2Driver.helpers.doFindElementOrEls (/mnt/sauce/appium/appium-v2.0.0/appium_home/linux/node_modules/appium-uiautomator2-driver/lib/commands/find.js:30:10)
    E       at doFind (/mnt/sauce/appium/appium-v2.0.0/appium_home/linux/node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver/lib/commands/find.js:36:17)
    E       at wrappedCondFn (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/basedriver/commands/timeout.ts:137:14)
    E       at spin (/mnt/sauce/appium/appium-v2.0.0/node_modules/asyncbox/lib/asyncbox.js:221:20)
    E       at waitForCondition (/mnt/sauce/appium/appium-v2.0.0/node_modules/asyncbox/lib/asyncbox.js:238:10)
    E       at AndroidUiautomator2Driver.implicitWaitForCondition (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/basedriver/commands/timeout.ts:139:12)
    E       at AndroidUiautomator2Driver.findElOrEls (/mnt/sauce/appium/appium-v2.0.0/appium_home/linux/node_modules/appium-uiautomator2-driver/node_modules/appium-android-driver/lib/commands/find.js:60:5)
    E       at AndroidUiautomator2Driver.findElOrElsWithProcessing (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/basedriver/commands/find.ts:60:12)
    E       at AndroidUiautomator2Driver.findElement (/mnt/sauce/appium/appium-v2.0.0/packages/base-driver/lib/basedriver/commands/find.ts:75:12)
    



    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_eth, id: 727229

    Device 2: Find Text by xpath: //android.view.ViewGroup[@content-desc='container']/android.widget.TextView[@text='Ether']/../android.widget.TextView[3]
    Device 2: Text is 0.06579 ETH

    critical/test_wallet.py:159: in test_wallet_send_eth
        self.errors.verify_no_errors()
    base_test_case.py:192: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Sender balance is not updated on Etherscan, it is 0.4175 but expected to be 0.4176
    



    Passed tests (5)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    @status-im-auto
    Copy link
    Member

    43% of end-end tests have passed

    Total executed tests: 7
    Failed tests: 4
    Expected to fail tests: 0
    Passed tests: 3
    
    IDs of failed tests: 727230,702742,703133,727229 
    

    Failed tests (4)

    Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    Test setup failed: critical/test_wallet.py:29: in prepare_devices
        self.loop.run_until_complete(
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:52: in run_in_parallel
        returns.append(await k)
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../views/sign_in_view.py:303: in recover_access
        self.chats_tab.wait_for_visibility_of_element(30)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatsTab by accessibility id:`chats-stack-tab` is not found on the screen after wait_for_visibility_of_element
    



    2. test_wallet_send_eth, id: 727229

    Device 1: Find Button by xpath: //*[@text="Cancel" or @text="CANCEL"]
    Device 1: Tap on found: Button

    Test setup failed: critical/test_wallet.py:29: in prepare_devices
        self.loop.run_until_complete(
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:52: in run_in_parallel
        returns.append(await k)
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../views/sign_in_view.py:303: in recover_access
        self.chats_tab.wait_for_visibility_of_element(30)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatsTab by accessibility id:`chats-stack-tab` is not found on the screen after wait_for_visibility_of_element
    



    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742

    Device 1: Find Button by xpath: //*[@text="Cancel" or @text="CANCEL"]
    Device 1: Tap on found: Button

    Test setup failed: critical/chats/test_public_chat_browsing.py:26: in prepare_devices
        self.home = self.sign_in.create_user(username=self.username)
    ../views/sign_in_view.py:274: in create_user
        self.chats_tab.wait_for_visibility_of_element(30)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatsTab by accessibility id:`chats-stack-tab` 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

    Test setup failed: critical/chats/test_public_chat_browsing.py:26: in prepare_devices
        self.home = self.sign_in.create_user(username=self.username)
    ../views/sign_in_view.py:274: in create_user
        self.chats_tab.wait_for_visibility_of_element(30)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatsTab by accessibility id:`chats-stack-tab` is not found on the screen after wait_for_visibility_of_element
    



    Passed tests (3)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    @status-im-auto
    Copy link
    Member

    50% of end-end tests have passed

    Total executed tests: 4
    Failed tests: 2
    Expected to fail tests: 0
    Passed tests: 2
    
    IDs of failed tests: 727230,727229 
    

    Failed tests (2)

    Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230
    Test setup failed: critical/test_wallet.py:29: in prepare_devices
        self.loop.run_until_complete(
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:52: in run_in_parallel
        returns.append(await k)
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../views/sign_in_view.py:303: in recover_access
        self.chats_tab.wait_for_visibility_of_element(30)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatsTab by accessibility id:`chats-stack-tab` is not found on the screen after wait_for_visibility_of_element
    



    2. test_wallet_send_eth, id: 727229

    Device 2: Find Button by xpath: //*[@text="Cancel" or @text="CANCEL"]
    Device 2: Tap on found: Button

    Test setup failed: critical/test_wallet.py:29: in prepare_devices
        self.loop.run_until_complete(
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:52: in run_in_parallel
        returns.append(await k)
    /usr/lib/python3.10/concurrent/futures/thread.py:58: in run
        result = self.fn(*self.args, **self.kwargs)
    ../views/sign_in_view.py:303: in recover_access
        self.chats_tab.wait_for_visibility_of_element(30)
    ../views/base_element.py:147: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatsTab by accessibility id:`chats-stack-tab` is not found on the screen after wait_for_visibility_of_element
    



    Passed tests (2)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    2. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    @mariia-skrypnyk
    Copy link

    Hi @ulisesmac !

    Thanks for your fix.
    I've checked it on both platforms.
    Loading on iOS was less then 1 sec, Android was 2 sec approx.
    And no error anymore when you opens particular image.
    Great job!

    @ulisesmac ulisesmac force-pushed the 21270-collectibles-stuck-watch-only-accs branch from 90aaf52 to ad74b1c Compare September 24, 2024 22:06
    @ulisesmac ulisesmac merged commit 5df1e6c into develop Sep 24, 2024
    6 checks passed
    @ulisesmac ulisesmac deleted the 21270-collectibles-stuck-watch-only-accs branch September 24, 2024 22:30
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Watch-only collectibles stuck in upload state and cannot read property 'h' of null error is shown on tap
    5 participants