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

Boosting an activity in the thread view does not automatically update the icon status #258

Closed
ivanminutillo opened this issue Apr 5, 2022 · 7 comments

Comments

@ivanminutillo
Copy link
Contributor

Clicking on the boost icon, it does not change its color untill an hard refresh

@ivanminutillo ivanminutillo added New Issue Please apply this label to any new issues :) Bug labels Apr 5, 2022
@antoniskalou
Copy link
Contributor

Before refresh:
before_refresh

After refresh:
after_refresh

@antoniskalou antoniskalou self-assigned this Apr 27, 2022
@mayel
Copy link
Member

mayel commented May 2, 2022

Related tests:

  1. test boost a post and it appears on my feed (Bonfire.Social.Activities.BoostPost.Test)
    forks/bonfire_social/test/social_web/activities/boost_post_test.exs:12
    Assertion with =~ failed
    code: assert view |> element(".feed [data-id='boost_action]") |> render_click() |> Floki.text() =~ "Boosted" left: "\n Search\n FeedsNotificationsMessagesLikes / FavouritesCristobal Nienow@hilton2003\n My Profile\n \n Switch User\n \n Settings\n \n Welcome\n \n Logout\n Go backTitleDescription\nPublicLocalMentionsMessageCustomPublicPublicly visible to everyone on the fediverse and in search enginesLocal InstanceVisible to all members of this instanceMentionsVisible only those mentioned, across the fediverseMessageVisible only to people included in this message thread: \n \n CW\n Post\n \n Menu\n Close panelCristobal Nienow@hilton20030\n Followers\n 0\n Following\n \n Profile\n \n Switch User\n \n Direct Messages\n \n Settings\n \n Home\n \n Logout\n Local\n Pete Larkin\n @roxane_wolff·\n 1 second ago\n \n here is an epic html post\n\n \n Boost\n \n Like\n \n Follow Pete Larkin Flag this Post Flag Pete Larkin\n Block Pete Larkin \n Popular hashtags#eurovision122 post#eurovision122 post#eurovision122 post#eurovision122 post#eurovision122 post#eurovision122 postCloseCancel"
    right: "Boosted"
    stacktrace:
    forks/bonfire_social/test/social_web/activities/boost_post_test.exs:24: (test)

@mayel
Copy link
Member

mayel commented May 2, 2022

Also because boost causes an extra activity to show in feed, need to figure out how to avoid this test failure:

  1. test unboost a post works (Bonfire.Social.Activities.BoostPost.Test)
    forks/bonfire_social/test/social_web/activities/boost_post_test.exs:42
    ** (ArgumentError) selector ".feed article:first-child() button[data-id='boost_action]" returned 2 elements and 2 of them matched the text filter "Boosted":

mayel added a commit to bonfire-networks/bonfire_social that referenced this issue May 6, 2022
mayel added a commit to bonfire-networks/bonfire_ui_social that referenced this issue May 6, 2022
@ivanminutillo
Copy link
Contributor Author

ivanminutillo commented May 8, 2022

could it be a bug in this function:

def send_updates(component_module, object_id, assigns) do
    debug("ComponentID: try to send_updates to #{component_module} for object id #{object_id}")

    for component_id <- ids(component_module, object_id) do
      debug("ComponentID: try stateful component with ID #{component_id}")
      Phoenix.LiveView.send_update(component_module, [id: component_id] ++ assigns)
    end
  end

which it does not address the original activity to update the boost, but only the new generated one?

@mayel
Copy link
Member

mayel commented May 8, 2022

That function sends an update to all stateful components in the current view that have been created using ComponentID.new(component_module, object_id), so it should be both...

@mayel
Copy link
Member

mayel commented May 31, 2022

The thing is that we also have an unusual behaviour in that you are able to boost something several times, so actually it makes sense for only the boost button on the actual boost activity to be an unboost button.

@mayel mayel removed the New Issue Please apply this label to any new issues :) label Jul 3, 2022
@mayel mayel mentioned this issue Feb 18, 2023
56 tasks
@mayel mayel added the Backlog label Feb 18, 2023
@mayel
Copy link
Member

mayel commented Nov 21, 2023

fixed

@mayel mayel closed this as completed Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants