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

Change view-id as per the selected bottom tab and refactor subscriptions #15636

Merged
merged 1 commit into from
Apr 19, 2023

Conversation

Parveshdhull
Copy link
Member

@Parveshdhull Parveshdhull commented Apr 12, 2023

fixes #15609

Summary

  • view-id will be changed as per selected bottom tabs
    (used to make sure react doesn't change the chats list component when other tabs are selected)
  • Removes some unnecessary subscription wrappers, which are not used anymore

Testing

Please check communities & chats home list items for any regressions.
Note: When the user will be on another tab then the chats-tab, and receive any new message, it will only be updated once he/she navigates back to the chats-tab.

@status-im-auto
Copy link
Member

status-im-auto commented Apr 12, 2023

Jenkins Builds

Click to see older builds (24)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 0d2cdf5 #1 2023-04-12 19:33:52 ~6 min android 🤖apk 📲
✔️ 0d2cdf5 #1 2023-04-12 19:33:55 ~6 min android-e2e 🤖apk 📲
✔️ 0d2cdf5 #1 2023-04-12 19:34:15 ~6 min tests 📄log
✔️ 0d2cdf5 #1 2023-04-12 19:34:48 ~7 min ios 📱ipa 📲
✔️ 18d941d #2 2023-04-13 17:08:51 ~5 min android-e2e 🤖apk 📲
✔️ 18d941d #2 2023-04-13 17:09:24 ~6 min android 🤖apk 📲
✔️ 18d941d #2 2023-04-13 17:09:42 ~6 min tests 📄log
✔️ 18d941d #2 2023-04-13 17:09:52 ~7 min ios 📱ipa 📲
✔️ c7e796e #3 2023-04-13 17:27:07 ~5 min android-e2e 🤖apk 📲
✔️ c7e796e #3 2023-04-13 17:27:36 ~6 min android 🤖apk 📲
✔️ c7e796e #3 2023-04-13 17:28:00 ~6 min tests 📄log
✔️ c7e796e #3 2023-04-13 17:29:36 ~8 min ios 📱ipa 📲
✔️ 5ee3f77 #6 2023-04-13 21:15:36 ~5 min android-e2e 🤖apk 📲
✔️ 5ee3f77 #6 2023-04-13 21:15:58 ~5 min android 🤖apk 📲
✔️ 5ee3f77 #6 2023-04-13 21:16:23 ~6 min tests 📄log
✔️ 5ee3f77 #6 2023-04-13 21:17:03 ~6 min ios 📱ipa 📲
✔️ 9c83655 #7 2023-04-14 11:30:26 ~5 min android 🤖apk 📲
✔️ 9c83655 #7 2023-04-14 11:30:43 ~6 min android-e2e 🤖apk 📲
✔️ 9c83655 #7 2023-04-14 11:31:15 ~6 min tests 📄log
✔️ 9c83655 #7 2023-04-14 11:32:30 ~7 min ios 📱ipa 📲
✔️ 9c83655 #9 2023-04-15 19:02:26 ~5 min android 🤖apk 📲
✔️ 9c83655 #9 2023-04-15 19:02:34 ~5 min android-e2e 🤖apk 📲
✔️ 9c83655 #9 2023-04-15 19:03:01 ~5 min tests 📄log
✔️ 9c83655 #9 2023-04-15 19:05:34 ~8 min ios 📱ipa 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 63338a1 #10 2023-04-18 11:02:58 ~5 min android 🤖apk 📲
✔️ 63338a1 #10 2023-04-18 11:04:27 ~6 min android-e2e 🤖apk 📲
✔️ 63338a1 #10 2023-04-18 11:04:33 ~6 min tests 📄log
✔️ 63338a1 #10 2023-04-18 11:04:52 ~7 min ios 📱ipa 📲
✔️ 7ba445f #11 2023-04-19 13:37:37 ~6 min tests 📄log
✔️ 7ba445f #11 2023-04-19 13:38:09 ~6 min android-e2e 🤖apk 📲
✔️ 7ba445f #11 2023-04-19 13:38:11 ~6 min android 🤖apk 📲
✔️ 7ba445f #11 2023-04-19 13:39:19 ~7 min ios 📱ipa 📲

@@ -1,38 +1,20 @@
(ns status-im2.subs.home
Copy link
Member Author

@Parveshdhull Parveshdhull Apr 12, 2023

Choose a reason for hiding this comment

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

Maybe we should rename home namespace to chats or some other more informative name

@status-im-auto
Copy link
Member

33% of end-end tests have passed

Total executed tests: 3
Failed tests: 2
Passed tests: 1
Not executed tests: 26
IDs of not executed tests: 702730,702782,702731,702745,702813,702855,702733,702783,702807,702732,702808,702838,702843,702839,702840,702841,702844,702894,702845,702786,702846,702742,702936,702947,702957,702958 
IDs of failed tests: 702850,702784 

Not executed tests (26)

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

    Click to expand
  • Rerun failed tests

  • Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Test setup failed: critical/chats/test_1_1_public_chats.py:908: in prepare_devices
        self.drivers, self.loop = create_shared_drivers(2)
     cannot unpack non-iterable NoneType object
    



    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850

    Device 2: Find Button by accessibility id: tab-recent
    Device 2: Tap on found: Button

    medium/test_activity_center.py:142: in test_activity_center_contact_request_decline
        self.errors.verify_no_errors()
    base_test_case.py:184: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Username is not shown on 'Add contact' page after entering valid public key 
    

    [[Blocked by 15500]]

    Device sessions

    Passed tests (1)

    Click to expand

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    @Parveshdhull
    Copy link
    Member Author

    Hi @rasom, Please take a look at 18d941d
    Not sure but it might also help #15609 (comment)

    @rasom
    Copy link
    Contributor

    rasom commented Apr 13, 2023

    @Parveshdhull in order to test it I need to open communities from discovery screen and currently app crashes when I'm trying to open that discovery screen

    @Parveshdhull
    Copy link
    Member Author

    Thank you for finding this issue, should be fixed now

    @rasom
    Copy link
    Contributor

    rasom commented Apr 13, 2023

    @Parveshdhull yep I can confirm it fixes #15609

    @Parveshdhull
    Copy link
    Member Author

    @Parveshdhull yep I can confirm it fixes #15609

    Thank you very much for finding the problem and testing.

    :<- [:view-id]
    (fn [[stacks view-id]]
    (if (= view-id :shell)
    (let [sorted-shell-cards (sort-by :clock > (map val stacks))]
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    @Parveshdhull can we do it in event handler on fetching cards instead of using atom? Or on handler which changes those stacks or something. If we need some pre calculated data I suppose it should happen in event handler.

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    Yes, it makes sense. will change it

    @@ -1,38 +1,20 @@
    (ns status-im2.subs.home
    (:require [re-frame.core :as re-frame]))

    (def memo-home-items (atom nil))
    (def memo-chats-stack-items (atom nil))
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    by all means computation function in reg-sub should be a pure function, that cashing likely shouldn't happen in subs layer

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    should be fixed now

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    Moved caching to the view itself instead of subscription. But looks like this slightly increase render time

    Caching in subscription render time

    old

    Caching in view render time

    new

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    probably render is also not the right place to memoize, ideally we use the re-frame subscription mechanism that already uses a cache internally?

    Copy link
    Member Author

    Choose a reason for hiding this comment

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

    For now keeping the caching in the subscription itself, due to performance. We can look more into this later on how to improve it.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Hey @cammellos, @rasom. @Parveshdhull recently mentioned this problem to me. I know it's been a while already, but here are my thoughts/findings. No action to be taken, just thoughts. This is going to be a long comment 🤷🏼

    The code in develop is still basically the same as when this PR was merged, so I used it as a basis to make the analysis.

    we want to keep data unchanged so react doesn't change component when we leave screen

    In develop, when I switch between screens (1:1 chats, AC, bottom tabs, etc), the subscription :chats-stack-items always re-runs because it depends on the signal :view-id. The cost of this subscription when there's a cache hit in memo-chats-stack-items is fairly small, but it's not zero.

    In develop, if we ignore the manual caching mechanism performed with memo-chats-stack-items, then the subscription :chats-stack-items is essentially a take call.

    (re-frame/reg-sub
     :chats-stack-items
     :<- [:chats/home-list-chats]
     :<- [:view-id]
     :<- [:home-items-show-number]
     (fn [[chats view-id home-items-show-number]]
       (take home-items-show-number chats)))

    And upon further inspection, we see that the view layer does more computation on the results of this subscription.

    ;; in component home.view/chats
    (let [unfiltered-items (rf/sub [:chats-stack-items])
          items            (filter-and-sort-items-by-tab selected-tab unfiltered-items)]
      ...)

    Therefore, the whole extra computation in filter-and-sort-items-by-tab is not being cached by re-frame.

    After I moved all the computation to the subscription (including the current tab argument, this is important), then when I switch between bottom tabs or other screens, re-frame doesn't re-run the subscription the component home.view/chats never re-renders.

    After switching screens, we get a hit in re-frame's subscription cache, which shows that when leaving or entering the Messages home screen nothing is re-computed or re-rendered. Obviously, if the user changes between Recent or Groups tabs, then the subscription will be re-computed and the view re-rendered.

    (re-frame.core/dispatch [:navigate-to :my-profile])
    (re-frame.subs/cache-lookup [:chats-stack-items :tab/recent])
    ;; => still returns cached chats which means nothing is re-rendered or sub re-computed.

    The new subscription looks like this:

    (re-frame/reg-sub
     :chats-stack-items
     :<- [:chats/home-list-chats]
     :<- [:home-items-show-number]
     (fn [[chats home-items-show-number] [_ tab]]
       (let [k (if (= tab :tab/groups) :group-chat :chat-id)]
         (->> chats
              (take home-items-show-number)
              (filter k)
              (sort-by :timestamp >)))))

    Here's the example video showing the new sub at play:

    device-2023-08-10-123339.webm

    I measured with re-frisk and the new code delivers the same level of performance. The differences I've seen in my comparisons are more like random fluctuations, which makes me think this manual caching mechanism is not needed.

    The upsides of the new code are:

    • The subscription doesn't re-run on screen changes throughout the app.
    • It is more idiomatic re-frame (no mutation in subscription).
    • It's simpler and the whole computation can be unit tested (because it's not split between sub & view).

    Side note: I micro-benchmarked the new subscription and the most expensive part is sorting, and because the collection is rather small for the value of home-items-show-number (e.g. 20), using a transducer didn't help because there is a negligible cost to garbage collect intermediary results. If the data coming through was already ordered by timestamp we could consider skipping sorting?

    But this sorting detail is in the range of micro optimizations. I would say optimizing the individual render item component chat-list-item/chat-list-item can bear more fruit. For example, it unfortunately creates subscriptions for every item of the flat list; it passes the whole chat instance to the notification component which makes Reagent's life more difficult to diff, and so on.

    Also, as far as I know, re-frame doesn't offer any mechanism to control when & how its query-cache is evicted (see https://github.com/day8/re-frame/blob/master/src/re_frame/subs.cljc#L46). One technique that's worth trying is playing with reg-sub-raw and the on-dispose callback. Sounds like a hack, but it's interesting nonetheless.

    Complete sidetracking, but I can't help but wish https://github.com/clojure/core.memoize was available for ClojureScript, because then we would be able to use less naive memoization techniques that are less likely to grow too much, e.g. LRU or TTL semantics (see https://github.com/clojure/core.memoize/blob/master/src/main/clojure/clojure/core/memoize.clj#L398). I'm sure this would give us new guns to shoot ourselves in the foot, but I used core.memoize in the past in certain problems and it really opens some good doors.

    That's all! 😅 Cheers!

    @status-im-auto
    Copy link
    Member

    96% of end-end tests have passed

    Total executed tests: 26
    Failed tests: 1
    Passed tests: 25
    
    IDs of failed tests: 702838 
    

    Failed tests (1)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_send_check_timestamps_sender_username, id: 702838

    Device 2: Verifying that 'hello' is under today
    Device 2: Looking for a message by text: hello

    critical/test_public_chat_browsing.py:418: in test_community_message_send_check_timestamps_sender_username
        channel.verify_message_is_under_today_text(message, self.errors)
    ../views/chat_view.py:923: in verify_message_is_under_today_text
        message_element.wait_for_visibility_of_element()
    ../views/base_element.py:135: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatElementByText by xpath:`//*[starts-with(@text,'hello')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element 
    

    [[blocked by 14797]]

    Device sessions

    Passed tests (25)

    Click to expand

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    2. test_activity_center_mentions, id: 702957
    Device sessions

    3. test_navigation_jump_to, id: 702936
    Device sessions

    4. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    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

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_offline_pn, id: 702808
    Device sessions

    3. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_mentions_push_notification, id: 702786
    Device sessions

    2. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    3. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    4. test_community_leave, id: 702845
    Device sessions

    5. test_community_message_edit, id: 702843
    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_unread_messages_badge, id: 702841
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    2. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    3. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    4. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    5. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    6. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    7. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    8. test_1_1_chat_edit_message, id: 702855
    Device sessions

    @Parveshdhull Parveshdhull force-pushed the feat/bottom-tabs-view-id branch 3 times, most recently from 5ee3f77 to 9c83655 Compare April 14, 2023 11:24
    @status-im-auto
    Copy link
    Member

    93% of end-end tests have passed

    Total executed tests: 29
    Failed tests: 2
    Passed tests: 27
    
    IDs of failed tests: 702850,702838 
    

    Failed tests (2)

    Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_send_check_timestamps_sender_username, id: 702838

    Device 2: Verifying that 'hello' is under today
    Device 2: Looking for a message by text: hello

    critical/test_public_chat_browsing.py:418: in test_community_message_send_check_timestamps_sender_username
        channel.verify_message_is_under_today_text(message, self.errors)
    ../views/chat_view.py:923: in verify_message_is_under_today_text
        message_element.wait_for_visibility_of_element()
    ../views/base_element.py:135: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatElementByText by xpath:`//*[starts-with(@text,'hello')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element 
    

    [[blocked by 14797]]

    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850

    Device 2: Find Button by accessibility id: tab-recent
    Device 2: Tap on found: Button

    medium/test_activity_center.py:142: in test_activity_center_contact_request_decline
        self.errors.verify_no_errors()
    base_test_case.py:184: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Username is not shown on 'Add contact' page after entering valid public key 
    

    [[Blocked by 15500]]

    Device sessions

    Passed tests (27)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    3. test_navigation_jump_to, id: 702936
    Device sessions

    4. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    2. test_1_1_chat_edit_message, id: 702855
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    5. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    6. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    7. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    8. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    9. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    5. test_community_leave, id: 702845
    Device sessions

    6. test_community_unread_messages_badge, id: 702841
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_message_edit, id: 702843
    Device sessions

    @Parveshdhull
    Copy link
    Member Author

    Parveshdhull commented Apr 15, 2023

    Test Commit shouldComponentUpdate: f96c96d (Not able to get caching behavior)
    Test Commit Move caching to view itself: 5ee3f77 (Increased render time)

    @status-im-auto
    Copy link
    Member

    93% of end-end tests have passed

    Total executed tests: 29
    Failed tests: 2
    Passed tests: 27
    
    IDs of failed tests: 702850,702838 
    

    Failed tests (2)

    Click to expand
  • Rerun failed tests

  • Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850

    Device 2: Find `Button` by `accessibility id`: `tab-recent`
    Device 2: Tap on found: Button

    medium/test_activity_center.py:142: in test_activity_center_contact_request_decline
        self.errors.verify_no_errors()
    base_test_case.py:184: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Username is not shown on 'Add contact' page after entering valid public key 
    

    [[Blocked by 15500]]

    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_message_send_check_timestamps_sender_username, id: 702838

    Device 2: Verifying that 'hello' is under today
    Device 2: Looking for a message by text: hello

    critical/test_public_chat_browsing.py:418: in test_community_message_send_check_timestamps_sender_username
        channel.verify_message_is_under_today_text(message, self.errors)
    ../views/chat_view.py:923: in verify_message_is_under_today_text
        message_element.wait_for_visibility_of_element()
    ../views/base_element.py:135: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: ChatElementByText by xpath:`//*[starts-with(@text,'hello')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']` is not found on the screen after wait_for_visibility_of_element 
    

    [[blocked by 14797]]

    Device sessions

    Passed tests (27)

    Click to expand

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    2. test_1_1_chat_edit_message, id: 702855
    Device sessions

    3. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    4. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    5. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    6. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783
    Device sessions

    7. test_1_1_chat_pin_messages, id: 702731
    Device sessions

    8. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    9. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    3. test_navigation_jump_to, id: 702936
    Device sessions

    4. test_activity_center_mentions, id: 702957
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    2. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    3. test_community_mentions_push_notification, id: 702786
    Device sessions

    4. test_community_contact_block_unblock_offline, id: 702894
    Device sessions

    5. test_community_leave, id: 702845
    Device sessions

    6. test_community_unread_messages_badge, id: 702841
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_message_edit, id: 702843
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Device sessions

    2. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    3. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_community_navigate_to_channel_when_relaunch, id: 702846
    Device sessions

    2. test_community_copy_and_paste_message_in_chat_input, id: 702742
    Device sessions

    @churik churik self-assigned this Apr 18, 2023
    @churik
    Copy link
    Member

    churik commented Apr 19, 2023

    @Parveshdhull thank you for PR!
    I haven't noticed any performance improvements or any regression in this PR.
    Below attached video with the same user rule dirt shuffle vintage trash cricket gesture door more robust fine tooth with the same steps.

    Nightly:

    FILE.2023-04-19.11.40.43.mp4

    PR build:

    FILE.2023-04-19.11.41.19.mp4

    Navigation is still twitchy, screens are jumping on and off, and the animation is far from smooth.
    So I wouldn't say that this PR fixes the initial issue, but if it is a required step for further investigation/improvements, we can merge it.

    @Parveshdhull
    Copy link
    Member Author

    Parveshdhull commented Apr 19, 2023

    Hi @churik, Thank you very much for testing the PR.

    PR makes sure that few screens(shell, home, communities) are only updated when we navigate to them (not in background). And on bonus, I was hoping it will fix #15609.

    So, there are two performance-related issues.

    1. App performance is slow in general (not only navigation) because screens are getting updates even when they are not in focus.
      In the original issue video around (1.30 min) even the scroll is slow, probably caused by this bug, and I hope it gets fixed by the current PR.

    2. Navigation is slow - twitchy and stumbled opening of screens.
      So what I think happens is, when we navigate to a screen, the screen opening animation starts. And even before this animation gets completed screen gets rendered and breaks the animation in between. As far as I know, this issue is also present in the old ui (android 1.19), maybe not that visible.

    We also faced a similar issue with bottom tabs, that's why we only load the current tab for the first time, once the animation is complete.

    I am currently not sure how to fix this issue, but as I will work on #15565, I hope it will also address animations related to navigation.

    First I am going to try if navigation provides functionality to implement the required feature and use better animation, if not, probably the next best option will be to implement chats & communities screen as bottom tabs, and control navigation and animation ourselves.

    @Parveshdhull
    Copy link
    Member Author

    Btw, is this twitchy navigation as you mentioned in the above video, is this affected by the number of communities or it is the same for even one community or chat?

    @churik
    Copy link
    Member

    churik commented Apr 19, 2023

    @Parveshdhull you're right, it seems not great for both cases, regardless of communities, though it seems a bit worse to me with communities (which is actually I have no idea how to check)

    So as the initial issue is not reproducible for me with slowing down the scrolling, I'll ask @VladimrLitvinenko to check on his device just in case and after this PR is ready to be merged.

    @churik
    Copy link
    Member

    churik commented Apr 19, 2023

    There are noticeable changes on low-level android device,thanks for checking @VladimrLitvinenko

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    No open projects
    Archived in project
    Development

    Successfully merging this pull request may close these issues.

    Android performance issues
    7 participants