Skip to content

Conversation

@seanstrom
Copy link
Contributor

@seanstrom seanstrom commented Mar 17, 2025

Summary

  • This PR removes an override for reagent's polyfill for requestAnimationFrame. Initially, the codebase used an override to configure to use a different polyfill, but now the override is not currently effective because of how the override is set. The fake-raf def is used by the next-tick def inside reagent, but both of those defs are evaluated before the override is set, meaning that the override does not take effect since we're not re-evaluating the next-tick def.

Platforms

  • Android
  • iOS

Steps to test

This change should not affect anything since it removes code that was not working, so it might be simplest to avoid manual testing unless it's just starting the app.

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Mar 17, 2025

Jenkins Builds

Click to see older builds (24)
Commit #️⃣ Finished (UTC) Duration Platform Result
186db0a #1 2025-03-17 17:10:43 ~11 min tests 📄log
✔️ 186db0a #1 2025-03-17 17:17:02 ~17 min android-e2e 🤖apk 📲
✔️ 186db0a #1 2025-03-17 17:17:48 ~18 min android 🤖apk 📲
✔️ 186db0a #1 2025-03-17 17:23:36 ~24 min ios 📱ipa 📲
✔️ 5fd5dfc #3 2025-03-21 11:06:29 ~5 min tests 📄log
✔️ 5fd5dfc #3 2025-03-21 11:10:09 ~9 min android-e2e 🤖apk 📲
✔️ 5fd5dfc #3 2025-03-21 11:10:57 ~10 min android 🤖apk 📲
✔️ 5fd5dfc #3 2025-03-21 11:13:01 ~12 min ios 📱ipa 📲
✔️ 8ca57b4 #4 2025-03-25 07:56:15 ~5 min tests 📄log
✔️ 8ca57b4 #4 2025-03-25 07:59:48 ~8 min android-e2e 🤖apk 📲
✔️ 8ca57b4 #4 2025-03-25 08:00:42 ~9 min android 🤖apk 📲
✔️ 8ca57b4 #4 2025-03-25 08:05:03 ~14 min ios 📱ipa 📲
✔️ ef5e7f2 #5 2025-03-25 12:27:32 ~12 min ios 📱ipa 📲
✔️ ef5e7f2 #5 2025-03-25 12:38:05 ~22 min tests 📄log
✔️ ef5e7f2 #5 2025-03-25 12:38:38 ~23 min android-e2e 🤖apk 📲
✔️ ef5e7f2 #5 2025-03-25 12:39:02 ~24 min android 🤖apk 📲
✔️ 0c1a037 #7 2025-03-26 09:06:10 ~4 min tests 📄log
✔️ 0c1a037 #7 2025-03-26 09:09:05 ~7 min android 🤖apk 📲
✔️ 0c1a037 #7 2025-03-26 09:09:18 ~7 min android-e2e 🤖apk 📲
✔️ 0c1a037 #7 2025-03-26 09:12:49 ~11 min ios 📱ipa 📲
✔️ b616d28 #8 2025-03-28 09:00:34 ~5 min tests 📄log
✔️ b616d28 #8 2025-03-28 09:04:07 ~9 min android-e2e 🤖apk 📲
✔️ b616d28 #8 2025-03-28 09:04:58 ~10 min android 🤖apk 📲
✔️ b616d28 #8 2025-03-28 09:06:20 ~11 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 0302b4e #9 2025-03-31 10:56:30 ~5 min tests 📄log
✔️ 0302b4e #9 2025-03-31 11:00:34 ~9 min android-e2e 🤖apk 📲
✔️ 0302b4e #9 2025-03-31 11:05:18 ~13 min ios 📱ipa 📲
0302b4e #10 2025-03-31 11:43:29 ~6.7 sec android 📄log
✔️ c85a5c1 #10 2025-03-31 11:49:23 ~4 min tests 📄log
✔️ c85a5c1 #11 2025-03-31 11:52:17 ~7 min android 🤖apk 📲
✔️ c85a5c1 #10 2025-03-31 11:52:45 ~8 min android-e2e 🤖apk 📲
✔️ c85a5c1 #10 2025-03-31 12:01:04 ~16 min ios 📱ipa 📲

Copy link
Contributor

@ilmotta ilmotta left a comment

Choose a reason for hiding this comment

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

If this wasn't working for so long, I think it's safe to remove it. On the other hand, should we override reagent.impl.batching/next-tick var to "fix the workaround"? And while doing so, shouldn't we demonstrate the override is better than the default behavior since years have passed and the override may not be necessary anymore?

@seanstrom
Copy link
Contributor Author

@ilmotta Yeah good questions, I had similar questions and discussed them with @flexsurfer

I think the conclusion we reached is that overriding the behaviour could have unforeseen consequences because of anything that relies of the subtle timings setTimeout with 0ms vs 16ms.

For example, if were to override next-tick we would likely be breaking this PR: #22278

So while we could correct the override, I'm not sure how it is needed. It seemed to be related to performance concerns in the past based on this PR: #10403

  • Specifically, the change from 16ms to 0ms seemed to be prompted by wanting to speed up reagent's redraw speed. Which we could do but I imagine the 16ms (60fps) delay would be used for batching the re-rendering.

@seanstrom seanstrom force-pushed the seanstrom/remove-reagent-override branch 4 times, most recently from 8ca57b4 to ef5e7f2 Compare March 25, 2025 12:14

;;;; re-frame RN setup
(set! interop/next-tick js/setTimeout)
(set! batching/fake-raf #(js/setTimeout % 0))
Copy link
Contributor

Choose a reason for hiding this comment

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

i would just comment this line, and add comment why it was commented

@seanstrom seanstrom force-pushed the seanstrom/remove-reagent-override branch from f78b391 to 0c1a037 Compare March 26, 2025 09:01
Comment on lines +38 to +50
;; Note: In the past we've configured reagent to run its batch rendering
;; faster by overriding the next-tick function. This technique could be useful
;; if we want to adjust the batch speed for different frame-rates since by
;; default reagent tunes its batch rendering for 60FPS.
;;
;; For example, this code would have batches rendering as fast as possible
;; (set! reagent.impl.batching/next-tick js/setImmediate)
;;
;; While this example would approximate 120FPS
;; (set! reagent.impl.batching/next-tick #(js/setTimeout % 8))
;;
;; And under the hood this is what reagent will use for approximately 60FPS:
;; (set! reagent.impl.batching/next-tick #(js/setTimeout % 16))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@flexsurfer I've added a comment explaining a little about the override with some example code. It's a little different that what you requested, but I hope it's still okay.

Small note:
In these comments, I reference overriding next-tick instead of fake-raf. Which this would be correct override moving forward (at least for now). So if we do end up wanting to un-comment these lines, they will work as intended.

Let me know what you think 🙏

@seanstrom seanstrom moved this from REVIEW to E2E Tests in Pipeline for QA Mar 27, 2025
@status-im-auto
Copy link
Member

50% of end-end tests have passed

Total executed tests: 14
Failed tests: 5
Expected to fail tests: 2
Passed tests: 7
Not executed tests: 2
IDs of not executed tests: 742015,742016 
IDs of failed tests: 727230,727231,740490,703133,702843 
IDs of expected to fail tests: 741840,741841 

Not executed tests (2)

Click to expand
  • Rerun not executed tests
  • Failed tests (5)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_profile_switch, id: 703133

    Device 1: Tap on found: Button
    # STEP: Check that removed user is not shown in the list anymore

    critical/chats/test_public_chat_browsing.py:246: in test_restore_multiaccount_with_waku_backup_remove_profile_switch
        self.errors.verify_no_errors()
    base_test_case.py:179: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 1: zQ3...dWXh5 was not restored as a contact from waku backup!
    E    Device 1: zQ3...Vacac was not restored as a contact from waku backup!
    E    Device 1: admin_open was not restored from waku-backup!!
    E    Device 1: member_open was not restored from waku-backup!!
    E    Device 1: admin_closed was not restored from waku-backup!!
    E    Device 1: member_closed was not restored from waku-backup!!
    



    Device sessions

    Class TestWalletOneDevice:

    1. test_wallet_add_remove_regular_account, id: 727231

    # STEP: Adding new regular account
    Device 1: Find Button by accessibility id: add-account

    critical/wallet/test_wallet_mainnet.py:357: in test_wallet_add_remove_regular_account
        self.wallet_view.add_regular_account(account_name=new_account_name)
    ../views/wallet_view.py:245: in add_regular_account
        self.add_account_button.click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by accessibility id: `add-account` 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_wallet_balance_mainnet, id: 740490

    Device 1: Find Button by accessibility id: network-dropdown
    Device 1: Tap on found: Button

    critical/wallet/test_wallet_mainnet.py:70: in test_wallet_balance_mainnet
        self.errors.verify_no_errors()
    base_test_case.py:179: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 1: For the USD Coin the wrong value 0.0 is shown, expected 5.0 in total
    E    Device 1: For the USD Coin the wrong value 0.0 is shown, expected 5.0 on Optimism
    



    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843

    Device 1: Find EmojisNumber by xpath: //*[starts-with(@text,'Message AFTER edit 2 (Edited)')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']/../..//*[@content-desc='emoji-reaction-2']/android.widget.TextView[2]
    Device 1: Element EmojisNumber text is equal to 1

    critical/chats/test_public_chat_browsing.py:388: in test_community_message_edit
        self.errors.verify_no_errors()
    base_test_case.py:179: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 2: Message is not edited
    



    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_asset_from_drawer, id: 727230

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

    critical/wallet/test_wallet_testnet.py:192: in test_wallet_send_asset_from_drawer
        self._check_balances_after_tx(amount_to_send, None, None, eth_amount_sender, eth_amount_receiver)
    critical/wallet/test_wallet_testnet.py:96: in _check_balances_after_tx
        self.loop.run_until_complete(
    /usr/lib/python3.10/asyncio/base_events.py:649: in run_until_complete
        return future.result()
    __init__.py:38: 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)
    critical/wallet/test_wallet_testnet.py:73: in wait_for_wallet_balance_to_update
        new_eth_amount = round(wallet_view.get_asset(asset_name='Ether').get_amount(), 4)
    ../views/wallet_view.py:193: in get_asset
        element.scroll_to_element(down_start_y=0.89, down_end_y=0.8)
    ../views/base_element.py:188: in scroll_to_element
        return self.find_element()
    ../views/base_element.py:83: in find_element
        raise exception
    ../views/base_element.py:76: in find_element
        return self.driver.find_element(self.by, self.locator)
    ../../../../status-app-prs@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@tmp/venv/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py:345: in execute
        self.error_handler.check_response(response)
    ../../../../status-app-prs@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: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
    E   Stacktrace:
    E   UnknownError: An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
    E       at UIA2Proxy.command (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/@appium/base-driver/lib/jsonwp-proxy/proxy.js:355:13)
    E       at runMicrotasks (<anonymous>)
    E       at processTicksAndRejections (node:internal/process/task_queues:96:5)
    E       at AndroidUiautomator2Driver.doFindElementOrEls (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/lib/commands/find.js:44:7)
    E       at doFind (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/appium-android-driver/lib/commands/find.ts:48:17)
    E       at wrappedCondFn (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/@appium/base-driver/lib/basedriver/commands/timeout.ts:137:14)
    E       at spin (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/asyncbox/lib/asyncbox.js:221:20)
    E       at waitForCondition (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/asyncbox/lib/asyncbox.js:238:10)
    E       at AndroidUiautomator2Driver.implicitWaitForCondition (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/@appium/base-driver/lib/basedriver/commands/timeout.ts:139:12)
    E       at AndroidUiautomator2Driver.findElOrEls (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/appium-android-driver/lib/commands/find.ts:71:5)
    E       at AndroidUiautomator2Driver.findElOrElsWithProcessing (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:60:12)
    E       at AndroidUiautomator2Driver.findElement (/root/lambda/shared-tools/volume/uiautomator/uiautomator-2.32.3/node_modules/@appium/base-driver/lib/basedriver/commands/find.ts:75:12)
    



    Expected to fail tests (2)

    Click to expand

    Class TestWalletCollectibles:

    1. test_wallet_send_collectible, id: 741840

    Device 1: Tap on found: Button
    Device 1: Find EditBox by accessibility id: address-text-input

    critical/wallet/test_collectibles.py:102: in test_wallet_send_collectible
        self.wallet_view.address_text_input.send_keys(self.receiver['wallet_address'])
    ../views/base_element.py:365: in send_keys
        self.find_element().send_keys(value)
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: EditBox by accessibility id: `address-text-input` 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 
    

    [[Collectibles list is not loaded sometimes]]

    2. test_wallet_collectible_send_from_expanded_info_view, id: 741841

    Device 1: Find Button by accessibility id: collectibles-tab
    Device 1: Tap on found: Button

    critical/wallet/test_collectibles.py:158: in test_wallet_collectible_send_from_expanded_info_view
        self.wallet_view.get_collectible_element('Glitch Punks').wait_for_element().click()
    ../views/base_element.py:120: in wait_for_element
        raise TimeoutException(
     Device `1`: `CollectibleItemElement` by` xpath`: `//*[@content-desc='collectible-list-item']//*[contains(@text,'Glitch Punks')]/../..` is not found on the screen after wait_for_element 
    

    [[Collectibles list is not loaded sometimes]]

    Passed tests (7)

    Click to expand

    Class TestWalletOneDevice:

    1. test_wallet_swap_flow_mainnet, id: 741555
    2. test_wallet_bridge_flow_mainnet, id: 741612
    3. test_wallet_send_flow_mainnet, id: 741554

    Class TestWalletCollectibles:

    1. test_wallet_collectibles_balance, id: 741839

    Class TestCommunityOneDeviceMerged:

    1. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletMultipleDevice:

    1. test_wallet_send_eth, id: 727229

    @pavloburykh pavloburykh force-pushed the seanstrom/remove-reagent-override branch from 0c1a037 to b616d28 Compare March 28, 2025 08:54
    @status-im-auto
    Copy link
    Member

    69% of end-end tests have passed

    Total executed tests: 16
    Failed tests: 5
    Expected to fail tests: 0
    Passed tests: 11
    
    IDs of failed tests: 741840,727230,742016,740490,741841 
    

    Failed tests (5)

    Click to expand
  • Rerun failed tests

  • Class TestWalletMultipleDevice:

    1. test_wallet_send_erc20_from_drawer[Optimism-USD Coin-USDC-2-0.01], id: 727230

    Device 1: Double tap on: Button
    Device 1: Find `Button` by `xpath`: `//*[@content-desc='send']/*[@content-desc='left-icon-for-action']`

    critical/wallet/test_wallet_testnet.py:82: in test_wallet_send_erc20_from_drawer
        self.wallet_1.send_asset_from_drawer(address=self.receiver['wallet_address'],
    ../views/wallet_view.py:244: in send_asset_from_drawer
        self.send_from_drawer_button.double_click()
    ../views/base_element.py:113: in double_click
        [self.find_element().click() for _ in range(2)]
    ../views/base_element.py:113: in <listcomp>
        [self.find_element().click() for _ in range(2)]
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//*[@content-desc='send']/*[@content-desc='left-icon-for-action']` 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_wallet_send_erc20_from_drawer[Mainnet-USD Coin-USDC-2-0.01], id: 742016

    Device 1: Find Button by xpath: //*[@content-desc='send']/*[@content-desc='left-icon-for-action']
    Device 1: Find Button by xpath: //*[@content-desc='network-list']/*[@text='Mainnet']

    critical/wallet/test_wallet_testnet.py:82: in test_wallet_send_erc20_from_drawer
        self.wallet_1.send_asset_from_drawer(address=self.receiver['wallet_address'],
    ../views/wallet_view.py:245: in send_asset_from_drawer
        self.select_network(network_name)
    ../views/wallet_view.py:212: in select_network
        xpath="//*[@content-desc='network-list']/*[@text='%s']" % network_name).click()
    ../views/base_element.py:89: in click
        element = self.find_element()
    ../views/base_element.py:78: in find_element
        raise NoSuchElementException(
     Device 1: Button by xpath: `//*[@content-desc='network-list']/*[@text='Mainnet']` 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 TestWalletOneDevice:

    1. test_wallet_balance_mainnet, id: 740490

    Device 1: Find Button by accessibility id: network-dropdown
    Device 1: Tap on found: Button

    critical/wallet/test_wallet_mainnet.py:70: in test_wallet_balance_mainnet
        self.errors.verify_no_errors()
    base_test_case.py:209: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 1: For the USD Coin the wrong value 0.0 is shown, expected 5.0 in total
    E    Device 1: For the USD Coin the wrong value 0.0 is shown, expected 5.0 on Optimism
    



    Class TestWalletCollectibles:

    1. test_wallet_send_collectible, id: 741840

    Device 1: Find SlideButton by xpath: //*[@resource-id='slide-button-track']
    Device 1: Click system back button

    critical/wallet/test_collectibles.py:155: in test_wallet_send_collectible
        self.errors.verify_no_errors()
    base_test_case.py:209: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 1: Max fee is not a number - <€0.01 on the Review Send page
    



    2. test_wallet_collectible_send_from_expanded_info_view, id: 741841

    Device 1: Swiping right on element SlideButton
    Device 1: Find SlideButton by xpath: //*[@resource-id='slide-button-track']

    critical/wallet/test_collectibles.py:207: in test_wallet_collectible_send_from_expanded_info_view
        self.errors.verify_no_errors()
    base_test_case.py:209: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Device 1: Max fee is not a number - <€0.01 on the Review Send page
    



    Passed tests (11)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestWalletCollectibles:

    1. test_wallet_collectibles_balance, id: 741839

    Class TestWalletOneDevice:

    1. test_wallet_swap_flow_mainnet, id: 741555
    2. test_wallet_add_remove_regular_account, id: 727231
    3. test_wallet_bridge_flow_mainnet, id: 741612
    4. test_wallet_send_flow_mainnet, id: 741554

    Class TestWalletMultipleDevice:

    1. test_send_eth[Arbitrum-0.0001], id: 742015
    2. test_send_eth[Status Network-0.0002], id: 727229

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_edit, id: 702843
    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_profile_switch, id: 703133
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    @seanstrom thanks for the PR. E2E failures are not PR related. Ready for merge.

    @pavloburykh pavloburykh moved this from E2E Tests to MERGE in Pipeline for QA Mar 28, 2025
    @seanstrom seanstrom force-pushed the seanstrom/remove-reagent-override branch from b616d28 to 0302b4e Compare March 31, 2025 10:51
    This change removes an override for reagent's polyfill for requestAnimationFrame.
    Initially, the codebase used an override to configure to use a different polyfill,
    but now the override is not currently effective because of how the override is set.
    The `fake-raf` def is used by the `next-tick` def inside reagent, but both of those
    defs are evaluated before the override is set, meaning that the override does not take
    effect since we're not re-evaluating the next-tick def.
    @seanstrom seanstrom force-pushed the seanstrom/remove-reagent-override branch from 0302b4e to c85a5c1 Compare March 31, 2025 11:44
    @seanstrom seanstrom merged commit 3836175 into develop Mar 31, 2025
    5 checks passed
    @github-project-automation github-project-automation bot moved this from MERGE to DONE in Pipeline for QA Mar 31, 2025
    @seanstrom seanstrom deleted the seanstrom/remove-reagent-override branch March 31, 2025 12:05
    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.

    5 participants