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

[#17964] emoji screen performance #18213

Merged
merged 8 commits into from
Dec 21, 2023
Merged

Conversation

ulisesmac
Copy link
Contributor

@ulisesmac ulisesmac commented Dec 16, 2023

fixes #17964

fixes #18212 <- this is a small issue that is also fixed in this PR

Summary

The emoji picker sheet performance needed to be improved in its opening/closing animations. This PR improves the performance:

Previous:
https://github.com/status-im/status-mobile/assets/90291778/61bcda80-603f-45d4-88c5-47e52ec102cb

now:
https://github.com/status-im/status-mobile/assets/90291778/9de91ab3-565a-4eb9-b205-cd1775a074e1

IMPORTANT

Even though performance has been improved, it still could be slow in some devices. This PR aims to improve the performance but completely solving the issue is a problem that would require a significant amount of time - maybe not in our priorities right now -.

Review notes

The previous fix consisted of delaying the rendering, this PR discarted that approach to reduce the user exposure to the blank screen, this is a screenshot in the middle of the animation, while the sheet is opening:

Before: vs now

Platforms

  • Android
  • iOS
Non-functional
  • CPU performance / speed of the app

Steps to test

  • Open Status
  • Go to wallet tab
  • Add account (+ button in last account card)
  • In the new account screen, pick the emoji icon to open the emoji picker.

status: ready

Comment on lines -49 to +52
(string/capitalize (first (name token)))]])
(some-> token
name
first
string/capitalize)]])
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 is the fix for #18212

Comment on lines 19 to 20
(->
(gesture/gesture-pan)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the -> sytle

curr-scroll (reagent/atom 0)]
(let [scroll-enabled (reagent/atom true)
curr-scroll (reagent/atom 0)
animating? (reagent/atom true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An atom that says if the current sheet is being animated or not.
I took the solution suggested by @smohamedjavid in a previous PR (#17891 (review))

Copy link
Member

Choose a reason for hiding this comment

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

Why reagent atoms? Why not shared value?

Copy link
Contributor

Choose a reason for hiding this comment

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

@Parveshdhull I don't think these atoms are used in animations

Copy link
Member

@Parveshdhull Parveshdhull Dec 18, 2023

Choose a reason for hiding this comment

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

The use of reagent atoms looks scary. Before you know, you are passing the same reagent atoms across several files (as we did in the messages screen), and a small reset force updates a whole bunch of screens.

They are not animations, still sharedValue value can also update the required parameters like reagent atoms without force updating the view. In other words

  1. animating? - animates property window-size
  2. scroll-enabled - animates property scroll-enabled
  3. curr-scroll - It looks like it just holds data that is used in drag-gesture, we can just use a simple atom here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @Parveshdhull

... a small reset force updates a whole bunch of screens.

Hmm... it doesn't work like that, as I said in this PR, I'm using a late deref approach, this aproach is also being used for the other atoms in this component.

Regarding to:

Before you know, you are passing the same reagent atoms across several files (as we did in the messages screen)

Probably the issue with messages screns was due to a different performance topic.

Remember Reagent does some optimizations before sending things to react, and if we don't perform a deref, the view is not re-rendered. Here's a small working example of the late deref approach and rerendering, that you can copy and test it:

(defn subcomponent-2 [{:keys [a-2]}]
  (println "subcomponent-2 repainted")
  ;; `a-2` is deref'ed only here, but traveled through all components.
  [quo/text (str "atom 2 value:" @a-2)])

(defn subcomponent-1 [{:keys [a-1 a-2]}]
  (println "subcomponent-1 repainted")
  [rn/view
   [quo/text (str "atom 1 value:" @a-1)]  ;; Here only `a-1` uses deref
   [subcomponent-2 {:a-2 a-2}]]) ;; Here we pass the atom `a-2`

(defn test-component []
  (let [atom-1        (reagent/atom 0)
        atom-2        (reagent/atom 0)
        update-atom-1 #(swap! atom-1 inc)
        update-atom-2 #(swap! atom-2 inc)]
    (fn []
      (println "test-component repainted")
      [rn/view
      ;; Atoms are being passed, we'll do the deref only inside the subcomponents (as in this bottom sheet component)
       [subcomponent-1 {:a-1 atom-1
                        :a-2 atom-2}]
       [quo/button {:on-press update-atom-1}
        "Update atom 1"]
       [quo/button {:on-press update-atom-2}
        "Update atom 2"]])))

It'll render the following:

image

Here is the result in the terminal after pressing the update atom 2 button 3 times, and after that pressing the update atom 1 three times:

  subcomponent-2 repainted
  subcomponent-2 repainted
  subcomponent-2 repainted
  
  subcomponent-1 repainted
  subcomponent-1 repainted
  subcomponent-1 repainted

So, it's easy to see that reseting (or swaping) the atom-2 didn't re-render the intermediate components.

On the other hand, if we pass derefed values instead of atoms:

;; Changing this call inside `test-component` and also removing the `@` insde subcomponents
[subcomponent-1 {:a-1 @atom-1
                 :a-2 @atom-2}]

then when press the update atom 2 button, the terminal will print:

test-component repainted
subcomponent-1 repainted
subcomponent-2 repainted

In that case it's actually re executing the render functions of the intermediate components.
But, as said before, that's not the approach in this component.

So @Parveshdhull wdyt?
IMO we shouldn't use shared values for something that aren't animations. Seems like a misuse.

Copy link
Member

@Parveshdhull Parveshdhull Dec 19, 2023

Choose a reason for hiding this comment

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

Thank you @ulisesmac for detailed explanation. Yes you are right, using sharedValue here, don't make much sense.
Should we just use simple atom for curr-scroll, it looks like it is just storing data?

Copy link
Member

Choose a reason for hiding this comment

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

Also, probably not in this PR, but should we consider using worklets for drag gesture for further improving performance?

Copy link
Contributor Author

@ulisesmac ulisesmac Dec 19, 2023

Choose a reason for hiding this comment

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

Sorry @Parveshdhull , I forgot to reply to it.

Should we just use simple atom for curr-scroll, it looks like it is just storing data?

I checked the rerenderings, and at least in the emoji picker it's not rerendering each time someone scrolls (since no one is performing deref on that atom).

I think changing that for a regular atom might create an unexpected behvaior in other screens since maybe some screens use it to trigger a re-render.

As said before, since this is not harmful in this screen, we can just keep it.

Regarding to:

Also, probably not in this PR, but should we consider using worklets for drag gesture for further improving performance?

Yes, maybe gestures can use worklets :) we could open an issue to improve the performance of the bottom sheet 👍

:scroll-enabled scroll-enabled
:current-scroll curr-scroll
:on-scroll #(on-scroll % curr-scroll)
:sheet-animating? animating?}]]]]))))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not a big fan of passing atoms as props to other components 😢 but this atom will travel a long path, tested it and using a late-deref approach improved the performance a little 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, have you considered using react context instead? it will help prevent the prop drilling, additionally you can instead pass accessor functions rather than the ratom. wdyt? 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It sounds as a good idea in terms of not passing the props through many components.

But, I think re-frame might be a simpler option. TBH, I know they solve the same problem, it seems just a matter of the JS world solution vs the Clojure world solution.

Right now, we are passing many atoms to the child of this component (the one I added is just another one). So we can consider adding either react-context or re-frame sub in a later refactoring to this component.

Also, we should consider if moving this helps in terms of readability and performance.

Thanks for the suggestion Jamie! Very interesting topic

@status-im-auto
Copy link
Member

status-im-auto commented Dec 16, 2023

Jenkins Builds

Click to see older builds (20)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4934a02 #1 2023-12-16 00:38:23 ~5 min tests 📄log
✔️ 4934a02 #1 2023-12-16 00:40:50 ~7 min ios 📱ipa 📲
✔️ 4934a02 #1 2023-12-16 00:41:43 ~8 min android 🤖apk 📲
✔️ 4934a02 #1 2023-12-16 00:41:43 ~8 min android-e2e 🤖apk 📲
✔️ 2c7556e #2 2023-12-18 22:19:47 ~4 min tests 📄log
✔️ 2c7556e #2 2023-12-18 22:20:45 ~5 min ios 📱ipa 📲
✔️ 2c7556e #2 2023-12-18 22:23:14 ~8 min android-e2e 🤖apk 📲
✔️ 2c7556e #2 2023-12-18 22:23:16 ~8 min android 🤖apk 📲
✔️ 802e8be #3 2023-12-19 01:35:12 ~4 min tests 📄log
✔️ 802e8be #3 2023-12-19 01:35:35 ~5 min ios 📱ipa 📲
✔️ 802e8be #3 2023-12-19 01:38:16 ~8 min android-e2e 🤖apk 📲
✔️ 802e8be #3 2023-12-19 01:38:21 ~8 min android 🤖apk 📲
✔️ be966b6 #4 2023-12-19 01:58:17 ~4 min tests 📄log
✔️ be966b6 #4 2023-12-19 02:01:34 ~8 min android-e2e 🤖apk 📲
✔️ be966b6 #4 2023-12-19 02:01:41 ~8 min android 🤖apk 📲
✔️ be966b6 #4 2023-12-19 02:06:14 ~12 min ios 📱ipa 📲
✔️ ec303d9 #5 2023-12-19 23:16:11 ~4 min tests 📄log
✔️ ec303d9 #5 2023-12-19 23:17:03 ~5 min ios 📱ipa 📲
✔️ ec303d9 #5 2023-12-19 23:19:34 ~8 min android-e2e 🤖apk 📲
✔️ ec303d9 #5 2023-12-19 23:19:40 ~8 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ be77d1b #6 2023-12-20 19:38:46 ~5 min ios 📱ipa 📲
✔️ be77d1b #6 2023-12-20 19:38:50 ~5 min tests 📄log
✔️ be77d1b #6 2023-12-20 19:40:08 ~6 min android 🤖apk 📲
✔️ be77d1b #6 2023-12-20 19:41:42 ~8 min android-e2e 🤖apk 📲
✔️ 516ec96 #7 2023-12-21 18:22:51 ~6 min tests 📄log
✔️ 516ec96 #7 2023-12-21 18:23:12 ~6 min ios 📱ipa 📲
✔️ 516ec96 #7 2023-12-21 18:24:29 ~8 min android-e2e 🤖apk 📲
✔️ 516ec96 #7 2023-12-21 18:24:32 ~8 min android 🤖apk 📲

Comment on lines 33 to 39
(let [viewable-item (-> (oops/oget event "viewableItems")
transforms/js->clj
first
:item)
(let [viewable-item (some-> event
(oops/oget "viewableItems")
(aget 0)
(.-item))
header? (and (map? viewable-item) (:header? viewable-item))
section-key (if header?
(:id viewable-item)
(:id (emoji-picker.data/emoji-group->category (-> viewable-item
first
:group))))]
(-> viewable-item first :group emoji-picker.data/emoji-group->category :id))]
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 function had a major improvement in performance! 😄
used the time function to wrap this piece of code, in develop it's taking ~22ms!! the less I got was 12ms and as much as 33ms.

Transfroming all values to only get the first item has a big impact in performance.
Now we are just extracting from that JS vector.
The time now for this function is 0.02ms ~ 0.03ms

Copy link
Member

Choose a reason for hiding this comment

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

The viewableItems inside the event sometimes give out nil when the user scrolls through the list. But some-> is a great choice to tackle that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smohamedjavid Yep, before adding some-> I had that issue 😅

Comment on lines 74 to 79
(defn- emoji-row
[row-data {:keys [on-select close]}]
(into [rn/view {:style style/emoji-row-container}]
(map-indexed
(fn [col-index {:keys [hexcode] :as emoji}]
^{:key hexcode}
[emoji-item emoji col-index on-select close])
row-data)))
(map-indexed (fn [col-index emoji]
[emoji-item emoji col-index on-select close]))
row-data))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Another improvement in performance in two aspects:

1. We don't need hexcode as key,

we need setting a :key when we return a sequence of elements, but this function is using into, so we are just returning hiccup.

Just to explain it better, we need :key metadata when:

[rn/something
  ( ;; <- a sequence
    ^{:key 1} [rn/something-else ...]
    ^{:key 2} [rn/something-else ...]
    ^{:key 3} [rn/something-else ...])]

since we are using into, we are returning just valid hiccup, no need of :key

[rn/something
 [rn/something-else ...]
 [rn/something-else ...]
 [rn/something-else ...])]

2. Using xform parameter of into

into allows the use of transducers (a transformation to data in a more performant way), and this piece of code was perfect for it, since we have:

  1. something we want to move into ([rn/view...])
  2. a transformation of data ((map-indexed (fn [...] ...))) that also returns a transducer when called with no params
  3. data (row-data).

So, I'm using into as:
(into [] [transformation data)
which is:
(into [rn/view...] (map-indexed ...) row-data)

If you'd like to read more about transducers:
https://clojure.org/reference/transducers

into
To apply a transducer to an input collection and construct a new output collection, use into (which efficiently uses reduce and transients if possible):

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the detailed explanation! @ulisesmac.

We need to keep the key in this case, as it's used to track views (when the items change) when the user is searching. If we remove the key, the list will see the last rendered item.

RPReplay_Final1702906615.MP4

We can't use col-index as it will be the same for every row. But, the hexcode is unique.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@smohamedjavid Thanks I fixed it!

IMO using hexocde is a nice approach!

Comment on lines 203 to 204
[:f> f-view
(merge sheet-opts
{:render-emojis? render-emojis?
:search-text search-text
:on-change-text on-change-text
:clear-states clear-states
:filtered-data @filtered-data
:set-scroll-ref set-scroll-ref
:on-select on-select
:on-viewable-items-changed on-viewable-items-changed
:active-category active-category
:scroll-ref scroll-ref})])))
(assoc sheet-opts
Copy link
Contributor Author

Choose a reason for hiding this comment

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

assoc instead of merge since we only want to add some keys to an existing map

@ulisesmac
Copy link
Contributor Author

@smohamedjavid

The code was pretty well written, congrats!,
TBH I was about to give up in this issue since I didn't find meaninful ways to improve the performance, I'd say it's almost the best we can do.

Maybe in the future we can consider using a virtualized-list and hashmaps instead of a sequence (since it's faster extracting from them), also we have immutable data structures by default, and using an immutable list is exactly the use case recommended for virtualized-list, wdyt?

@@ -16,8 +16,7 @@
[status-im2.contexts.emoji-picker.utils :as emoji-picker.utils]
Copy link
Contributor

Choose a reason for hiding this comment

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

Not related to this pr but somewhat important to note. The concept of "Contexts" was for large feature chunks - e.g messaging, communities, onboarding etc.
Emoji picker should live in somewhere like status-im2.common.emoji-picker imo. We can make a follow up pr to move it. 👍

Copy link
Member

Choose a reason for hiding this comment

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

yeah context and common getting messy, re-evaluation is needed, i remember @ilmotta had a vision how it should work

Copy link
Contributor

Choose a reason for hiding this comment

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

Correct guys, contexts is just an abbreviation for bounded contexts from DDD. We're not doing DDD, but still, the idea is to separate domains because they tend to evolve in very different ways. We have a glossary and a link to explain what context means. emoji-picker as a bounded context makes no sense.

https://github.com/status-im/status-mobile/blob/4934a02f881b02c1ed3d76c028b052e3e3715609/doc/new-guidelines.md#glossary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, totally agree, let's move it in a follow up! 👍

@OmarBasem
Copy link
Contributor

@ulisesmac would be good to add a before and after video for PRs involving animations/performance

@flexsurfer
Copy link
Member

flexsurfer commented Dec 18, 2023

@OmarBasem
Copy link
Contributor

@OmarBasem i believe there are videos in the description

Previous: https://github.com/status-im/status-mobile/assets/90291778/61bcda80-603f-45d4-88c5-47e52ec102cb

now: https://github.com/status-im/status-mobile/assets/90291778/9de91ab3-565a-4eb9-b205-cd1775a074e1

Oh did not notice, the videos aren't rendering inline. Thank you.

src/status_im2/common/bottom_sheet_screen/style.cljs Outdated Show resolved Hide resolved
curr-scroll (reagent/atom 0)]
(let [scroll-enabled (reagent/atom true)
curr-scroll (reagent/atom 0)
animating? (reagent/atom true)
Copy link
Member

Choose a reason for hiding this comment

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

Why reagent atoms? Why not shared value?

src/status_im2/contexts/emoji_picker/view.cljs Outdated Show resolved Hide resolved
src/status_im2/contexts/emoji_picker/view.cljs Outdated Show resolved Hide resolved
Comment on lines 74 to 79
(defn- emoji-row
[row-data {:keys [on-select close]}]
(into [rn/view {:style style/emoji-row-container}]
(map-indexed
(fn [col-index {:keys [hexcode] :as emoji}]
^{:key hexcode}
[emoji-item emoji col-index on-select close])
row-data)))
(map-indexed (fn [col-index emoji]
[emoji-item emoji col-index on-select close]))
row-data))
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the detailed explanation! @ulisesmac.

We need to keep the key in this case, as it's used to track views (when the items change) when the user is searching. If we remove the key, the list will see the last rendered item.

RPReplay_Final1702906615.MP4

We can't use col-index as it will be the same for every row. But, the hexcode is unique.

@smohamedjavid
Copy link
Member

Maybe in the future we can consider using a virtualized-list and hashmaps instead of a sequence (since it's faster extracting from them), also we have immutable data structures by default, and using an immutable list is exactly the use case recommended for virtualized-list, wdyt?

@ulisesmac - The flat-list is a wrapper of virtualized-list and we can use the props of virtualized-list in the flatlist. The problem we have is displaying the picker in a bottom sheet which receives the user's gesture for closing the sheet. We can only use the flat-list provided by the react-native-gesture-handler (not from react-native). If we use any other list renderers, the scroll will not work in Android as the swipe gesture is received on the sheet and makes the list unusable.

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.

Thanks @ulisesmac!

The PR seems reasonable to merge (apart from this comment that needs a fix https://github.com/status-im/status-mobile/pull/18213/files?diff=unified&w=1#r1430132704). I don't have much to add, so I'm approving in advance.

Just a note, although the code is being improved in some ways perf wise, I couldn't experience a noticeable different on my Android device.

src/status_im2/contexts/emoji_picker/view.cljs Outdated Show resolved Hide resolved
@@ -16,8 +16,7 @@
[status-im2.contexts.emoji-picker.utils :as emoji-picker.utils]
Copy link
Contributor

Choose a reason for hiding this comment

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

Correct guys, contexts is just an abbreviation for bounded contexts from DDD. We're not doing DDD, but still, the idea is to separate domains because they tend to evolve in very different ways. We have a glossary and a link to explain what context means. emoji-picker as a bounded context makes no sense.

https://github.com/status-im/status-mobile/blob/4934a02f881b02c1ed3d76c028b052e3e3715609/doc/new-guidelines.md#glossary

Copy link
Contributor

@OmarBasem OmarBasem left a comment

Choose a reason for hiding this comment

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

Emoji screen performance is better now, thanks @ulisesmac 👍

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.

Nice work! @ulisesmac 🚀 🚀 🚀

@flexsurfer
Copy link
Member

Why reagent atoms? Why not shared value?

probably it's next step from performance crew

@ulisesmac ulisesmac force-pushed the 17964-emoji-screen-performance branch from be966b6 to ec303d9 Compare December 19, 2023 23:11
@status-im-auto
Copy link
Member

81% of end-end tests have passed

Total executed tests: 48
Failed tests: 5
Expected to fail tests: 4
Passed tests: 39
IDs of failed tests: 703297,702936,703391,703629,703382 
IDs of expected to fail tests: 702732,703503,702731,702808 

Failed tests (5)

Click to expand
  • Rerun failed tests

  • Class TestCommunityOneDeviceMerged:

    1. test_community_mute_community_and_channel, id: 703382

    Device 1: Getting cats channel element in community
    Device 1: Looking for chat: 'cats'

    critical/chats/test_public_chat_browsing.py:143: in test_community_mute_community_and_channel
        self.community_view.get_channel(self.channel_name).long_press_element()
    ../views/base_element.py:312: in long_press_element
        element = self.find_element()
    ../views/home_view.py:74: in find_element
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 1: ChatElement by xpath:`//*[@content-desc='channel-list-item']//*[starts-with(@text,'# cats')]/..` 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: 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:1141: 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”"
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_send_image_save_and_share, id: 703391

    Device 2: Find Button by accessibility id: image-0
    Device 2: Click system back button

    critical/chats/test_1_1_public_chats.py:453: in test_1_1_chat_send_image_save_and_share
        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))]))
     Not expected image is shown to the receiver.
    



    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_send_image_save_and_share, id: 703297

    Device 3: Find ChatsTab by accessibility id: chats-stack-tab
    Device 3: Tap on found: ChatsTab

    critical/chats/test_group_chat.py:282: in test_group_chat_send_image_save_and_share
        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))]))
     Not expected image is shown to the admin.
    E    Not expected image is shown to the member_2.
    



    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936

    Device 1: Find Button by accessibility id: jump-to
    Device 1: Click system back button

    activity_center/test_activity_center.py:263: in test_navigation_jump_to
        self.channel_1.wait_for_staleness_of_element(element)
    ../views/base_view.py:842: in wait_for_staleness_of_element
        raise TimeoutException(
     Device 1: expected element is not stale after 10 seconds
    



    Device sessions

    Expected to fail tests (4)

    Click to expand

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    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 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

    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_edit_delete_message_when_offline, id: 704615
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    9. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    10. test_community_message_edit, id: 702843
    Device sessions

    11. test_community_unread_messages_badge, id: 702841
    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 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 TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    3. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    4. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    5. test_1_1_chat_edit_message, id: 702855
    Device sessions

    6. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495
    Device sessions

    2. test_group_chat_reactions, id: 703202
    Device sessions

    3. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    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

    @status-im-auto
    Copy link
    Member

    81% of end-end tests have passed

    Total executed tests: 48
    Failed tests: 5
    Expected to fail tests: 4
    Passed tests: 39
    
    IDs of failed tests: 703495,703297,702936,703391,702947 
    
    IDs of expected to fail tests: 702732,703503,702731,702808 
    

    Failed tests (5)

    Click to expand
  • Rerun failed tests

  • Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_mute_chat, id: 703495

    Device 2: Find `UnreadMessagesCountText` by `xpath`: `//*[@content-desc="chats-stack-tab"]/*[@resource-id='counter-component']/android.widget.TextView`
    Device 2: Find `PreveiewMessageText` by `xpath`: `//*[@content-desc='author-primary-name'][starts-with(@text,'yddndnt')]/..//*[@content-desc='chat-message-text']`

    critical/chats/test_group_chat.py:482: in test_group_chat_mute_chat
        if not chat.chat_preview.text.startswith("%s: %s" % (self.usernames[2], unmuted_message)):
    ../views/base_element.py:407: in text
        text = self.find_element().text
    ../views/base_element.py:79: in find_element
        raise NoSuchElementException(
     Device 2: PreveiewMessageText by xpath: `//*[@content-desc='author-primary-name'][starts-with(@text,'yddndnt')]/..//*[@content-desc='chat-message-text']` 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_group_chat_send_image_save_and_share, id: 703297

    Device 3: Find ChatsTab by accessibility id: chats-stack-tab
    Device 3: Tap on found: ChatsTab

    critical/chats/test_group_chat.py:282: in test_group_chat_send_image_save_and_share
        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))]))
     Not expected image is shown to the admin.
    E    Not expected image is shown to the member_2.
    



    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_send_image_save_and_share, id: 703391

    Device 2: Find Button by accessibility id: image-0
    Device 2: Click system back button

    critical/chats/test_1_1_public_chats.py:453: in test_1_1_chat_send_image_save_and_share
        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))]))
     Not expected image is shown to the receiver.
    



    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_navigation_jump_to, id: 702936

    Device 2: Tap on found: Button
    Device 2: Attempt 0 is successful clicking close-activity-center

    Test setup failed: activity_center/test_activity_center.py:224: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:383: in handle_contact_request
        chat_element.accept_contact_request()
    ../views/home_view.py:150: in accept_contact_request
        self.handle_cr("accept-contact-request")
    ../views/home_view.py:147: in handle_cr
        ).wait_for_rendering_ended_and_click()
    ../views/base_element.py:155: in wait_for_rendering_ended_and_click
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by xpath:`//*[contains(@text, 'user1')]/ancestor::*[@content-desc='activity']/*[@content-desc="accept-contact-request"]` is not found on the screen after wait_for_visibility_of_element
    



    Device sessions

    2. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947

    Test setup failed: activity_center/test_activity_center.py:224: in prepare_devices
        self.home_2.handle_contact_request(self.username_1)
    ../views/home_view.py:383: in handle_contact_request
        chat_element.accept_contact_request()
    ../views/home_view.py:150: in accept_contact_request
        self.handle_cr("accept-contact-request")
    ../views/home_view.py:147: in handle_cr
        ).wait_for_rendering_ended_and_click()
    ../views/base_element.py:155: in wait_for_rendering_ended_and_click
        self.wait_for_visibility_of_element(20)
    ../views/base_element.py:139: in wait_for_visibility_of_element
        raise TimeoutException(
     Device 2: Button by xpath:`//*[contains(@text, 'user1')]/ancestor::*[@content-desc='activity']/*[@content-desc="accept-contact-request"]` is not found on the screen after wait_for_visibility_of_element
    



    Expected to fail tests (4)

    Click to expand

    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 TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

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

    Class TestCommunityOneDeviceMerged:

    1. test_community_discovery, id: 703503

    Test is not run, e2e blocker  
    

    [[reason: [NOTRUN] Curated communities not loading, https://github.com//issues/17852]]

    Passed tests (39)

    Click to expand

    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 TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    3. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    4. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    5. test_1_1_chat_edit_message, id: 702855
    Device sessions

    6. test_1_1_chat_message_reaction, id: 702730
    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

    Class TestDeepLinksOneDevice:

    1. test_links_open_universal_links_from_chat, id: 704613
    Device sessions

    2. test_links_deep_links, id: 702775
    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 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_edit_delete_message_when_offline, id: 704615
    Device sessions

    7. test_community_message_delete, id: 702839
    Device sessions

    8. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    9. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    10. test_community_message_edit, id: 702843
    Device sessions

    11. test_community_unread_messages_badge, id: 702841
    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

    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

    @VolodLytvynenko VolodLytvynenko self-assigned this Dec 20, 2023
    @VolodLytvynenko
    Copy link
    Contributor

    hey @ulisesmac Thank you for the PR. One issue is found on the emoji screen that I've noticed also on the latest nightly. It seems to be related to performance. Do you think it might be resolved within the scope of this PR, or would it be better to address it separately?

    ISSUE 1: [IOS] Disappearing emojis when selecting a filter during scrolling in emoji drawer on iOS

    Steps:

    1. Open the emoji drawer.
    2. Begin scrolling through the emojis.
    3. While the emoji drawer is actively scrolled, tap on a filter option located below the emojis

    Actual result:

    When scrolling through the emojis and simultaneously selecting a filter, the emojis disappear from view.

    emojiios.mp4

    Expected result:

    The emojis should remain displayed

    Device:

    iPhone 11 Pro max, IOS 16

    @ulisesmac
    Copy link
    Contributor Author

    ulisesmac commented Dec 20, 2023

    @VolodLytvynenko
    Thanks for testing and finding this issue.

    I'd prefer opening an issue for it, since it'll take some time to solve it, and this PR is mainly focused on the performance while opening the sheet.

    For sure that is something that needs to be solved.

    Edit:

    Here's the issue:
    #18264

    BTW, is this PR ready to get merged?

    @ulisesmac ulisesmac force-pushed the 17964-emoji-screen-performance branch from ec303d9 to be77d1b Compare December 20, 2023 19:32
    @VolodLytvynenko
    Copy link
    Contributor

    Hi @ulisesmac Thank you for the follow-up creation. PR is ready to be merged

    @ulisesmac ulisesmac force-pushed the 17964-emoji-screen-performance branch from be77d1b to 516ec96 Compare December 21, 2023 18:16
    @ulisesmac ulisesmac merged commit 5fa9c0c into develop Dec 21, 2023
    6 checks passed
    @ulisesmac ulisesmac deleted the 17964-emoji-screen-performance branch December 21, 2023 21:44
    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.

    Cannot read property ChatrAt of null Wallet: Improve emoji screen gesture/scrolling performance
    10 participants