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

Add featured-community data #16015 #16232

Merged
merged 1 commit into from
Jun 21, 2023
Merged

Add featured-community data #16015 #16232

merged 1 commit into from
Jun 21, 2023

Conversation

erikseppanen
Copy link
Contributor

fixes #16015

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Jun 8, 2023

Jenkins Builds

Click to see older builds (45)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ ae8c925 #1 2023-06-08 20:57:33 ~5 min android-e2e 🤖apk 📲
✔️ ae8c925 #1 2023-06-08 20:58:14 ~6 min ios 📱ipa 📲
✔️ ae8c925 #1 2023-06-08 20:59:01 ~6 min android 🤖apk 📲
✔️ ae8c925 #1 2023-06-08 21:00:27 ~8 min tests 📄log
✔️ 36c20c0 #2 2023-06-09 14:01:36 ~5 min android-e2e 🤖apk 📲
✔️ 36c20c0 #2 2023-06-09 14:02:01 ~6 min ios 📱ipa 📲
✔️ 36c20c0 #2 2023-06-09 14:02:52 ~7 min android 🤖apk 📲
✔️ 36c20c0 #2 2023-06-09 14:03:58 ~8 min tests 📄log
✔️ f82b337 #3 2023-06-09 20:36:18 ~6 min android 🤖apk 📲
✔️ f82b337 #3 2023-06-09 20:36:31 ~6 min android-e2e 🤖apk 📲
✔️ f82b337 #3 2023-06-09 20:37:46 ~7 min tests 📄log
✔️ f82b337 #3 2023-06-09 20:37:56 ~7 min ios 📱ipa 📲
✔️ eb02042 #4 2023-06-12 19:14:24 ~5 min android 🤖apk 📲
✔️ eb02042 #4 2023-06-12 19:15:20 ~6 min android-e2e 🤖apk 📲
✔️ eb02042 #4 2023-06-12 19:15:29 ~6 min ios 📱ipa 📲
✔️ eb02042 #4 2023-06-12 19:17:27 ~8 min tests 📄log
✔️ 32fc342 #5 2023-06-13 16:00:16 ~5 min android-e2e 🤖apk 📲
✔️ 32fc342 #5 2023-06-13 16:00:30 ~5 min android 🤖apk 📲
✔️ 32fc342 #5 2023-06-13 16:00:34 ~5 min ios 📱ipa 📲
✔️ 32fc342 #5 2023-06-13 16:02:37 ~7 min tests 📄log
✔️ a93c980 #6 2023-06-15 01:30:52 ~5 min ios 📱ipa 📲
✔️ a93c980 #6 2023-06-15 01:31:31 ~6 min android-e2e 🤖apk 📲
✔️ a93c980 #6 2023-06-15 01:31:41 ~6 min android 🤖apk 📲
✔️ a93c980 #6 2023-06-15 01:32:39 ~7 min tests 📄log
✔️ 72bba0e #7 2023-06-15 01:39:34 ~5 min ios 📱ipa 📲
✔️ 08c5102 #8 2023-06-15 01:45:08 ~5 min ios 📱ipa 📲
✔️ 08c5102 #8 2023-06-15 01:45:46 ~6 min android 🤖apk 📲
✔️ 08c5102 #8 2023-06-15 01:46:32 ~6 min android-e2e 🤖apk 📲
✔️ 08c5102 #8 2023-06-15 01:48:01 ~8 min tests 📄log
13041b0 #9 2023-06-15 15:53:11 ~3 min tests 📄log
✔️ 13041b0 #9 2023-06-15 15:55:48 ~5 min android-e2e 🤖apk 📲
✔️ 13041b0 #9 2023-06-15 15:55:58 ~5 min ios 📱ipa 📲
✔️ 13041b0 #9 2023-06-15 15:56:00 ~5 min android 🤖apk 📲
✔️ 2af4611 #10 2023-06-19 03:06:39 ~5 min ios 📱ipa 📲
✔️ 2af4611 #10 2023-06-19 03:06:42 ~5 min android 🤖apk 📲
✔️ 2af4611 #10 2023-06-19 03:06:44 ~5 min android-e2e 🤖apk 📲
✔️ 2af4611 #10 2023-06-19 03:08:48 ~7 min tests 📄log
✔️ d08cc22 #11 2023-06-20 16:43:44 ~5 min ios 📱ipa 📲
✔️ d08cc22 #11 2023-06-20 16:43:46 ~5 min android-e2e 🤖apk 📲
✔️ d08cc22 #11 2023-06-20 16:44:08 ~6 min android 🤖apk 📲
✔️ d08cc22 #11 2023-06-20 16:45:36 ~7 min tests 📄log
✔️ b872e5d #12 2023-06-21 02:37:20 ~5 min ios 📱ipa 📲
✔️ b872e5d #12 2023-06-21 02:37:41 ~5 min android 🤖apk 📲
✔️ b872e5d #12 2023-06-21 02:39:00 ~7 min android-e2e 🤖apk 📲
✔️ b872e5d #12 2023-06-21 02:40:36 ~8 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ cc6b515 #13 2023-06-21 13:30:39 ~6 min android-e2e 🤖apk 📲
✔️ cc6b515 #13 2023-06-21 13:31:10 ~6 min android 🤖apk 📲
✔️ cc6b515 #13 2023-06-21 13:32:41 ~8 min ios 📱ipa 📲
✔️ cc6b515 #13 2023-06-21 13:35:08 ~10 min tests 📄log
✔️ b259cb3 #14 2023-06-21 13:59:21 ~6 min android 🤖apk 📲
✔️ b259cb3 #14 2023-06-21 13:59:31 ~6 min android-e2e 🤖apk 📲
✔️ b259cb3 #14 2023-06-21 14:01:06 ~7 min ios 📱ipa 📲
✔️ b259cb3 #14 2023-06-21 14:01:43 ~8 min tests 📄log

src/status_im2/subs/root.cljs Show resolved Hide resolved
Copy link
Contributor

@J-Son89 J-Son89 left a comment

Choose a reason for hiding this comment

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

Looks good to me! Nice work @erikseppanen 😎

(assoc-in db [:featured-communities id] (<-rpc community)))
db
(mapv #(get (:communities communities) (keyword %))
(:contractFeaturedCommunities communities)))})
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this key be kebab case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review @J-Son89!

done

@status-im-auto
Copy link
Member

70% of end-end tests have passed

Total executed tests: 33
Failed tests: 10
Passed tests: 23
IDs of failed tests: 702958,703194,702859,702855,702732,702894,702783,702957,702731,702838 

Failed tests (10)

Click to expand
  • Rerun failed tests

  • Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194

    # STEP: Check gallery on second device
    Device 2: Find `Button` by `accessibility id`: `jump-to`

    critical/test_public_chat_browsing.py:557: in test_community_several_images_send_reply
        self.channel_2.jump_to_communities_home()
    ../views/base_view.py:605: in jump_to_communities_home
        self.jump_to_button.click()
    ../views/base_element.py:91: in click
        self.find_element().click()
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 2: Button by accessibility id: `jump-to` is not found on the screen
    



    Device sessions

    2. test_community_one_image_send_reply, id: 702859

    Device 1: Find RepliedMessageText by xpath: //*[starts-with(@text,'reply to image')]/preceding::android.widget.TextView[@content-desc='quoted-message']
    Device 1: RepliedMessageText is description

    critical/test_public_chat_browsing.py:548: in test_community_one_image_send_reply
        self.errors.verify_no_errors()
    base_test_case.py:182: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Reply message was not received by the sender
    



    Device sessions

    3. test_community_contact_block_unblock_offline, id: 702894

    Device 1: Find ChatElementByText by xpath: //*[starts-with(@text,'Hurray! unblocked')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']
    Device 1: Find MemberPhoto by xpath: //*[starts-with(@text,'Hurray! unblocked')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='user-avatar']

    critical/test_public_chat_browsing.py:741: in test_community_contact_block_unblock_offline
        chat_element.member_photo.click()
    ../views/base_element.py:91: in click
        self.find_element().click()
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 1: MemberPhoto by xpath: `//*[starts-with(@text,'Hurray! unblocked')]/ancestor::android.view.ViewGroup[@content-desc='chat-item']//*[@content-desc='user-avatar']` is not found on the screen
    



    Device sessions

    4. test_community_message_send_check_timestamps_sender_username, id: 702838

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

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



    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_admin_notification_accept_swipe, id: 702958

    # STEP: Clearing history
    Device 2: Find Button by accessibility id: jump-to

    medium/test_activity_center.py:289: in test_activity_center_admin_notification_accept_swipe
        self.home_2.jump_to_messages_home()
    ../views/base_view.py:601: in jump_to_messages_home
        self.jump_to_button.click()
    ../views/base_element.py:91: in click
        self.find_element().click()
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 2: Button by accessibility id: `jump-to` is not found on the screen
    



    Device sessions

    2. test_activity_center_mentions, id: 702957

    Device 1: Find CommunitiesTab by accessibility id: communities-stack-tab
    Device 2: Find Button by accessibility id: jump-to

    medium/test_activity_center.py:255: in test_activity_center_mentions
        self.home_2.jump_to_card_by_text('# %s' % self.channel_name)
    ../views/base_view.py:609: in jump_to_card_by_text
        self.jump_to_button.click()
    ../views/base_element.py:91: in click
        self.find_element().click()
    ../views/base_element.py:80: in find_element
        raise NoSuchElementException(
     Device 2: Button by accessibility id: `jump-to` is not found on the screen
    



    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732

    Test is not run, e2e blocker  
    

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

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_edit_message, id: 702855

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

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

    [[Message is being in status 'Sending' for a long time: https://github.com//issues/15385]]

    Device sessions

    2. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    # STEP: Device1 goes back online and checks that 1-1 chat will be fetched
    Device 1: Looking for a message by text: test message

    critical/chats/test_1_1_public_chats.py:1250: in test_1_1_chat_is_shown_message_sent_delivered_from_offline
        self.errors.verify_no_errors()
    base_test_case.py:182: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message status was not delivered after back up online, it is "Sending"! 
    

    [[Issue with messages not being sent for a long time]]

    Device sessions

    3. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

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

    Passed tests (23)

    Click to expand

    Class TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    2. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_navigation_jump_to, id: 702936
    Device sessions

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    2. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    2. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    3. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    4. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    5. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    6. 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_restore_multiaccount_with_waku_backup_remove_switch, id: 703133
    Device sessions

    3. 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_leave, id: 702845
    Device sessions

    5. test_community_unread_messages_badge, id: 702841
    Device sessions

    6. test_community_message_delete, id: 702839
    Device sessions

    7. test_community_mark_all_messages_as_read, id: 703086
    Device sessions

    8. test_community_message_edit, id: 702843
    Device sessions

    @VolodLytvynenko
    Copy link
    Contributor

    VolodLytvynenko commented Jun 12, 2023

    hi @erikseppanen . Thank you for PR. Please, take a look at the following issue:

    ISSUE 1: Community in the featured section does not match the design until user logs in again

    Steps to reproduce:

    1. Create at least 1 community
    2. Open discovery page
    3. Tap current community (after community is opened, it will be shown in the 'featured' section)
    4. Observe community in the 'featured section'

    Actual result:

    Community is not matched to design until user is re-logged

    com_design.mp4

    Expected result:

    Community is matched to design in the 'featured' section

    @erikseppanen
    Copy link
    Contributor Author

    @VladimrLitvinenko To simulate zero featured communities, I commented out the insertion of fetched community data as requested here

    @erikseppanen
    Copy link
    Contributor Author

    erikseppanen commented Jun 12, 2023

    Thanks @VladimrLitvinenko!

    ISSUE 1: I'm not sure how to reproduce this behavior. It might have something to do with being configured with the appropriate pokt, infura, etc. tokens, which I add during development.

    @cammellos
    Copy link
    Contributor

    I am not sure we should show created communities in the featured section, I take only communities from the contract should be shown there (unless we are doing that for testing), just to confirm, @John-44

    (apologies if that's something you arranged for testing)

    @John-44
    Copy link

    John-44 commented Jun 12, 2023

    I am not sure we should show created communities in the featured section, I take only communities from the contract should be shown there (unless we are doing that for testing), just to confirm, @John-44

    (apologies if that's something you arranged for testing)

    @cammellos @erikseppanen @VladimrLitvinenko The only communities that should be shown in the Community Directory are communities curated by the Community Directory Curation dApp.

    This applies to both all communities, and featured communities. This data should come from the curation dApp and nowhere else.

    @pavloburykh pavloburykh self-assigned this Jun 13, 2023
    @pavloburykh
    Copy link
    Contributor

    pavloburykh commented Jun 13, 2023

    @erikseppanen @cammellos @osmaczko thank you for all details provided in #16015

    Unfortunately we still do not have clear understanding of how properly test this PR.

    Couple of questions:

    1. What is the exact list of communities that should be shown in Feature section and All communities section according to this contract https://goerli-optimism.etherscan.io/address/0x22EE86A14b49890957fE71990073C6C68E05F9C5 ?

    2. For testing purposes is there some way how we can add/remove communities which are taken from this contract? Or it is okay for now just to check that those communities that are currently present in contract are fetched in the app?

    3. Should be anything additional done in terms of app settings in order we see the expected communities data to be shown ?

    4. @erikseppanen I am wondering if "All communities" vertical section has been also affected by this PR? Asking as I see 3 communities in this section which are NOT shown/fetched in develop build.

    Those are: (old) Status Community, Contributor's test community, From contract to portal. Are those coming from this contract https://goerli-optimism.etherscan.io/address/0x22EE86A14b49890957fE71990073C6C68E05F9C5 ?

    photo_2023-06-13 14 24 45

    1. I am also reproducing issue 1 reported by @VladimrLitvinenko

    Couple details regarding this issue (all of them can be observed in the video below):

    • after user has been just registered broken (empty) community is being shown in Feature section
    • opening communities from All community section results in showing the last opened of those community when opening broken one from Featured section.
    • after some time (which does not depend on app re-login) Feature section starts showing Contributor's test community
    telegram-cloud-document-2-5206442369339108360.mp4

    @erikseppanen
    Copy link
    Contributor Author

    @osmaczko thank you so much for your answer.

    @erikseppanen based on the details provided by @osmaczko I see following issues:

    1. Basically this is [issue 1](https://github.com/status-im/status-mobile/pull/16232#issuecomment-1587628278). We might need some input from the @status-im/design-team on how we should show community which data is not fetched yet from waku. Or maybe we should not show community card at all until data is fetched. Because interaction with such community causes issues described in item 5 of my comment [here](https://github.com/status-im/status-mobile/pull/16232#issuecomment-1589112823)
    
    2. Communities listed in All communities section on mobile differs from the list fetched on desktop.
       **On mobile** I see following communities in All communities section: Status; (old) Status Community; Contributor's test community; From contract to portal.
       While on **desktop** there are only 2 communities fetched by default from existing contract: (old) Status Community, From contract to portal. I understand that All communities section might not be in scope of this PR but still as we can see this section has been affected by this PR (list of communities of this section differs from the list in develop).
    

    Thanks @pavloburykh!

    Issue 2 is fixed: both top and bottom "Discover Community" sections are contract communities data (same as desktop app).

    Issue 1: Could you verify the issue still exists?

    src/status_im/communities/core.cljs Outdated Show resolved Hide resolved
    src/status_im2/contexts/communities/discover/view.cljs Outdated Show resolved Hide resolved
    src/status_im2/subs/communities.cljs Outdated Show resolved Hide resolved
    src/status_im/communities/core.cljs Outdated Show resolved Hide resolved
    src/status_im/communities/core.cljs Outdated Show resolved Hide resolved
    src/status_im/communities/core.cljs Outdated Show resolved Hide resolved
    @pavloburykh
    Copy link
    Contributor

    Issue 2 is fixed: both top and bottom "Discover Community" sections are contract communities data (same as desktop app).

    Issue 1: Could you verify the issue still exists?

    Thanx @erikseppanen ! Issue 2 is fixed.

    Issue 1 is fixed partially: broken community does not appear. Community appears after data is fetched from waku. The remained issue is communities are not fetched until app re-opening (you can observe the behaviour on video below). Is it possible to refresh data from waku without need to re-login the app?

    telegram-cloud-document-2-5213424762096725022.mp4

    @pavloburykh
    Copy link
    Contributor

    @erikseppanen also could you please ping me up when review comments will be resolved? After that I will re-test to make sure no regression has been introduced. Thanx!

    @erikseppanen erikseppanen force-pushed the issue-16015 branch 2 times, most recently from a0108c5 to 13041b0 Compare June 15, 2023 15:49
    [taoensso.timbre :as log]
    [utils.re-frame :as rf]))

    (defn camel->kebab
    Copy link
    Member

    Choose a reason for hiding this comment

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

    have you seen this (utils.collection/map-keys csk/->kebab-case-keyword data) in the code, so it seems it could be used ? cc @ilmotta

    Copy link
    Member

    Choose a reason for hiding this comment

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

    or actually if its so simple function, probably we don't need to use external library, and better to use this one but move it to utils

    Copy link
    Contributor Author

    @erikseppanen erikseppanen Jun 15, 2023

    Choose a reason for hiding this comment

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

    @flexsurfer I've seen that library, but haven't fully explored the pros/cons of using it for this. The current solution is pretty small and specific to communities (we have some special handling here, for predicates and public keys that the library isn't going to do for us).

    Copy link
    Contributor

    @ilmotta ilmotta Jun 15, 2023

    Choose a reason for hiding this comment

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

    I don't see a reason to not use the library. It's a well known, tested, small library in the Clojure community, so implementing our own camel to kebab transformation function is just a waste of time IMO. It's already in our shadow-cljs.edn.

    have you seen this (utils.collection/map-keys csk/->kebab-case-keyword data) in the code, so it seems it could be used

    @flexsurfer, this implementation works very well for converting the map keys, but it's not recursive. Which is also good in some occasions if we're sure we don't need to recursively convert the data structures. For a recursive solution, we just need to use cske/transform-keys combined with csk/->kebab-case-keyword, both provided by the library.

    Every major Clojure codebase I worked with that had to interface with JSON APIs needed a recursive transformation function for converting keys.

    For those places where performance is critical we might want to benchmark and do a more direct conversion. Maybe using assoc + dissoc could lead to faster results than rename-keys or cske/transform-keys, but I have no clue. But again, this would only be necessary if we can meaningfully measure a slow down.

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    I think we should use the library at least to transform from camel -> kebab since it's already implemented and tested, reimplement the recursive key transformation seems a lot of work.

    btw, why do we have keywords starting with a number?

    Converts keys that start with a digit (0-9) from keywords to strings (:0x0324 -> "0x0324")

    AFAIK, this kind of keywords are supported because early Clojure wrongly allowed them to exist so they keep supporting them, but they are not recommended.

    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 @ilmotta @ulisesmac Thanks for the feedback!

    I added some tests and renamed the functions, to give a better idea of what's involved here. Also, here's what the input data looks like: wakuext_curatedCommunities

    1. JSON API: the data is not strictly JSON, although it does include camel->kebab conversion. For example, the keys are already keywords, and it performs additional operations that are not related to camel->kebab conversion (renaming predicates, stringifying number-prefixed keys, and recursion to transform nested maps). The camel->kebab conversion is just one line of code: (string/lower-case (string/replace s #"([a-z])([A-Z])" "$1-$2")), which looks for a lowercase letter followed by an uppercase letter, puts a dash between them, then lowercases everything. This camel->kebab conversion is maybe 10% of the solution.
    2. Motivation: I wrote these to replace the existing communities.core set/rename-keys functions. While working on this PR, I noticed that not only would would it require another <- function, but that there were already many camelcase words in the data that had been missed (not converted to kebab case). So I concluded that the current key-by-key approach leads to keys being overlooked.
    3. Specific to contract communities: The current key-by-key renaming approach is used many times in the codebase, but I can't testify to those conversions following the same rules as contract communities here.
    4. General utility function: Creating a general utility function would entail additional analysis of the conversion rules of all the other data structures that use the key-by-key renaming approach, well suited for a separate PR that can be prioritized appropriately.
    5. camel-snake-kebab library: I've used this library before, for transforming mongodb JSON documents. In that case, an approach was needed that would convert documents that were universally JSON, with little control over the the actual field names. It is important to note that the library does not presume the format it is converting FROM: it has to do the work of figuring out whether the input string is PascalCase, HTTP-Header-Case, or whatever before converting it to the desired case (non-trivial code). Our use-case here is to convert a single data structure once, at startup, whose fieldnames we can reliably predict because we define them. While I don't think we necessarily need a library for this, I went ahead and replaced the line of code I mentioned above with (csk/->kebab-case-string s).

    predicate? (keyword (str lower-cased "?"))
    :else (keyword lower-cased))))

    (defn rename-keys
    Copy link
    Member

    Choose a reason for hiding this comment

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

    also would be cool to move this to some sort of utilities namespace

    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 think so too! But it's only been used for communities so far (for example, changing public keys from keywords to strings might not be universally desired).

    Perhaps we could expand it as a utility to be used universally in another PR?

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    I think the existing file src/utils/transforms.cljs is the proper place in the codebase for this sort of thing, since the function should be general enough to not require any specific domain knowledge.

    @pavloburykh
    Copy link
    Contributor

    Issue 2 is fixed: both top and bottom "Discover Community" sections are contract communities data (same as desktop app).
    Issue 1: Could you verify the issue still exists?

    Thanx @erikseppanen ! Issue 2 is fixed.

    Issue 1 is fixed partially: broken community does not appear. Community appears after data is fetched from waku. The remained issue is communities are not fetched until app re-opening (you can observe the behaviour on video below). Is it possible to refresh data from waku without need to re-login the app?

    telegram-cloud-document-2-5213424762096725022.mp4

    @erikseppanen could you please elaborate on this comment? Current issue is high priority from perspective of newly created user and what content he will see after entering Discovery communities screen for the first time. And currently he will not see any communities as we do not update data until app re-login.

    Also, designers have added a design for skeleton of community cards https://www.figma.com/file/h9wo4GipgZURbqqr1vShFN/Communities-for-Mobile?type=design&node-id=12510-427273&t=TyfKww2h28KiCitk-0 So until communities data is fetched we should show such skeleton. But this feature can be logged and addressed as follow-up in order not to block current PR.

    Communities for Mobile – Figma 2023-06-21 10-57-55

    @status-im-auto
    Copy link
    Member

    79% of end-end tests have passed

    Total executed tests: 33
    Failed tests: 7
    Passed tests: 26
    
    IDs of failed tests: 703133,702732,702783,702894,702855,703086,702731 
    

    Failed tests (7)

    Click to expand
  • Rerun failed tests

  • Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_pin_messages, id: 702732
    Test is not run, e2e blocker  
    

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

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_is_shown_message_sent_delivered_from_offline, id: 702783

    # STEP: Device1 goes back online and checks that 1-1 chat will be fetched
    Device 1: Looking for a message by text: test message

    critical/chats/test_1_1_public_chats.py:1253: in test_1_1_chat_is_shown_message_sent_delivered_from_offline
        self.errors.verify_no_errors()
    base_test_case.py:182: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message status was not delivered after back up online, it is "Sending"! 
    

    [[Issue with messages not being sent for a long time]]

    Device sessions

    2. test_1_1_chat_edit_message, id: 702855

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

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

    [[Message is being in status 'Sending' for a long time: https://github.com//issues/15385]]

    Device sessions

    3. test_1_1_chat_pin_messages, id: 702731

    Test is not run, e2e blocker  
    

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

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_contact_block_unblock_offline, id: 702894

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

    critical/test_public_chat_browsing.py:772: in test_community_contact_block_unblock_offline
        self.errors.verify_no_errors()
    base_test_case.py:182: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     Message was not delivered after back up online.
    



    Device sessions

    2. test_community_mark_all_messages_as_read, id: 703086

    Device 1: Find Button by accessibility id: mark-as-read
    Device 1: Tap on found: Button

    critical/test_public_chat_browsing.py:799: in test_community_mark_all_messages_as_read
        self.errors.verify_no_errors()
    base_test_case.py:182: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     New messages counter is not shown in home > Commmunity element
    



    Device sessions

    Class TestCommunityOneDeviceMerged:

    1. test_restore_multiaccount_with_waku_backup_remove_switch, id: 703133

    Device 1: Find Button by accessibility id: show-profiles
    Device 1: Tap on found: Button

    critical/test_public_chat_browsing.py:399: in test_restore_multiaccount_with_waku_backup_remove_switch
        self.errors.verify_no_errors()
    base_test_case.py:182: in verify_no_errors
        pytest.fail('\n '.join([self.errors.pop(0) for _ in range(len(self.errors))]))
     admin_open was not restored from waku-backup!!
    E    member_open was not restored from waku-backup!!
    E    admin_closed was not restored from waku-backup!!
    E    member_closed was not restored from waku-backup!!
    E    Contact Chu_QA was not restored from backup!
    E    Contact my-custom-nickname was not restored from backup!
    



    Device sessions

    Passed tests (26)

    Click to expand

    Class TestGroupChatMultipleDeviceMergedNewUI:

    1. test_group_chat_join_send_text_messages_push, id: 702807
    Device sessions

    2. test_group_chat_offline_pn, id: 702808
    Device sessions

    Class TestCommunityMultipleDeviceMerged:

    1. test_community_several_images_send_reply, id: 703194
    Device sessions

    2. test_community_message_delete, id: 702839
    Device sessions

    3. test_community_leave, id: 702845
    Device sessions

    4. test_community_one_image_send_reply, id: 702859
    Device sessions

    5. test_community_message_edit, id: 702843
    Device sessions

    6. test_community_mentions_push_notification, id: 702786
    Device sessions

    7. test_community_links_with_previews_github_youtube_twitter_gif_send_enable, id: 702844
    Device sessions

    8. test_community_message_send_check_timestamps_sender_username, id: 702838
    Device sessions

    9. test_community_unread_messages_badge, id: 702841
    Device sessions

    10. test_community_emoji_send_copy_paste_reply, id: 702840
    Device sessions

    Class 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 TestActivityCenterContactRequestMultipleDevicePR:

    1. test_activity_center_contact_request_accept_swipe_mark_all_as_read, id: 702851
    Device sessions

    2. test_activity_center_contact_request_decline, id: 702850
    Device sessions

    Class TestOneToOneChatMultipleSharedDevicesNewUi:

    1. test_1_1_chat_push_emoji, id: 702813
    Device sessions

    2. test_1_1_chat_text_message_delete_push_disappear, id: 702733
    Device sessions

    3. test_1_1_chat_message_reaction, id: 702730
    Device sessions

    4. test_1_1_chat_emoji_send_reply_and_open_link, id: 702782
    Device sessions

    5. test_1_1_chat_delete_via_long_press_relogin, id: 702784
    Device sessions

    6. test_1_1_chat_non_latin_messages_stack_update_profile_photo, id: 702745
    Device sessions

    Class TestActivityMultipleDevicePR:

    1. test_activity_center_reply_read_unread_delete_filter_swipe, id: 702947
    Device sessions

    2. test_navigation_jump_to, id: 702936
    Device sessions

    3. test_activity_center_mentions, id: 702957
    Device sessions

    4. test_activity_center_admin_notification_accept_swipe, id: 702958
    Device sessions

    @pavloburykh
    Copy link
    Contributor

    Issue 2 is fixed: both top and bottom "Discover Community" sections are contract communities data (same as desktop app).
    Issue 1: Could you verify the issue still exists?

    Thanx @erikseppanen ! Issue 2 is fixed.
    Issue 1 is fixed partially: broken community does not appear. Community appears after data is fetched from waku. The remained issue is communities are not fetched until app re-opening (you can observe the behaviour on video below). Is it possible to refresh data from waku without need to re-login the app?
    telegram-cloud-document-2-5213424762096725022.mp4

    @erikseppanen could you please elaborate on this comment? Current issue is high priority from perspective of newly created user and what content he will see after entering Discovery communities screen for the first time. And currently he will not see any communities as we do not update data until app re-login.

    Also, designers have added a design for skeleton of community cards https://www.figma.com/file/h9wo4GipgZURbqqr1vShFN/Communities-for-Mobile?type=design&node-id=12510-427273&t=TyfKww2h28KiCitk-0 So until communities data is fetched we should show such skeleton. But this feature can be logged and addressed as follow-up in order not to block current PR.

    Communities for Mobile – Figma 2023-06-21 10-57-55

    agreed with @erikseppanen to address it in followup issue. PR is ready for merge.

    @erikseppanen erikseppanen merged commit d91e67c into develop Jun 21, 2023
    @erikseppanen erikseppanen deleted the issue-16015 branch June 21, 2023 14:07
    @John-44
    Copy link

    John-44 commented Jun 21, 2023

    @erikseppanen @pavloburykh Note that the app should start trying to fetch the featured community as soon as the app has launched, not when the user visits this screen. And this information should then be cached. And if the latest fetch of this data hasn't been completed, the previously cached data should be displayed instead.

    So with this scheme, other than literally the first time the user logs into the app, the user should never see the skeleton loading screen (because there will always be data stored locally to be displayed)

    @pavloburykh
    Copy link
    Contributor

    @erikseppanen @pavloburykh Note that the app should start trying to fetch the featured community as soon as the app has launched, not when the user visits this screen. And this information should then be cached. And if the latest fetch of this data hasn't been completed, the previously cached data should be displayed instead.

    So with this scheme, other than literally the first time the user logs into the app, the user should never see the skeleton loading screen (because there will always be data stored locally to be displayed)

    @John-44 thank you for clarification. I will leave your comment in follow up issue description.

    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.

    Plug in data from the community service