LemmyNet / lemmy-ui

The official web app for lemmy.
https://join-lemmy.org/
GNU Affero General Public License v3.0
888 stars 334 forks source link

Communities page Subscribe buttons not working on Voyager #2215

Closed Die4Ever closed 11 months ago

Die4Ever commented 11 months ago

Requirements

Summary

the Subscribe button in the communities list is not working on Voyager https://voyager.lemmy.ml/communities?listingType=All&sort=TopMonth&page=1

Going to the community and clicking Subscribe in the sidebar does appear to be working

Steps to Reproduce

  1. go to https://voyager.lemmy.ml/communities?listingType=All&sort=TopMonth&page=1
  2. click Subscribe on the community and notice that nothing happens
  3. refreshing the page shows you are still not subscribed

Technical Details

I don't see any errors appear in the console when I click, but I do see a POST request to https://voyager.lemmy.ml/api/v3/community/follow

{"community_id":4,"follow":false}

seems like it should be requesting with follow: true not false

This does work if I try it on programming.dev, which is running 0.18.5

Lemmy Instance Version

0.19.0-rc.4

Lemmy Instance URL

https://voyager.lemmy.ml/communities?listingType=All&sort=TopMonth&page=1

Die4Ever commented 11 months ago

Still doesn't seem to be working in 0.19.0 rc5 on Voyager while logged in

https://voyager.lemmy.ml/communities?listingType=All&sort=TopMonth&page=1

Die4Ever commented 11 months ago

yea on voyager.lemmy.ml I'm still seeing this request payload

{"community_id":11,"follow":false}

and this response

{
    "community_view": {
        "community": {
            "id": 11,
            "name": "asklemmy",
            "title": "Asklemmy",
            "description": "A loosely moderated place to ask open-ended questions\n\n**[Search asklemmy](https://lemmy.ml/search?q=&type=Posts&listingType=All&communityId=8&page=1&sort=TopAll) 🔍**\n\nIf your post meets the following criteria, it's welcome here!\n\n1. Open-ended question\n2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.\n3. **Not regarding using or support for Lemmy**: [context](https://lemmy.ml/post/1223478), see the list of support communities and tools for finding communities below\n4. Not ad nauseam inducing: please make sure it is a question that would be new to most members\n5. [An actual topic of discussion](https://lemmy.ml/post/1239589)\n\nLooking for support? \n\n* [!lemmy_support@lemmy.ml](https://lemmy.ml/c/lemmy_support) \n* [!fediverse@lemmy.ml](https://lemmy.ml/c/fediverse) \n* [!selfhosted@lemmy.world](https://lemmy.world/c/selfhosted) \n\nLooking for a community? \n\n* [Lemmyverse](https://lemmyverse.net/communities): community search \n* [sub.rehab](https://sub.rehab/): maps old subreddits to fediverse options, marks official as such \n* [!lemmy411@lemmy.ca](https://lemmy.ca/c/lemmy411): a community for finding communities \n\n~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~",
            "removed": false,
            "published": "2019-04-25T04:58:33.886275Z",
            "updated": "2023-07-27T08:58:41.602101Z",
            "deleted": false,
            "nsfw": false,
            "actor_id": "https://lemmy.ml/c/asklemmy",
            "local": false,
            "icon": "https://lemmy.ml/pictrs/image/d3d059e3-fa3d-45af-ac93-ac894beba378.png",
            "banner": "https://lemmy.ml/pictrs/image/36d2d6b4-9133-43eb-a980-5aa44939b904.png",
            "hidden": false,
            "posting_restricted_to_mods": false,
            "instance_id": 2
        },
        "subscribed": "NotSubscribed",
        "blocked": false,
        "counts": {
            "community_id": 11,
            "subscribers": 39664,
            "posts": 208,
            "comments": 2217,
            "published": "2019-04-25T04:58:33.886275Z",
            "users_active_day": 133,
            "users_active_week": 914,
            "users_active_month": 1047,
            "users_active_half_year": 1166
        }
    },
    "discussion_languages": []
}
Die4Ever commented 11 months ago

thanks for reopening, to clarify

the Subscribe button in the communities list is not working, the text never changes and just always says "Subscribe"

going to the community and clicking Subscribe in the sidebar is working

which leads me to believe this is purely a front end issue, also the javascript appears to be requesting to unsubscribe instead of subscribe judging by the json payload in the follow request, it's doing "follow":false but if I try it on programming.dev then it correctly requests with "follow":true

I tested this with both remote and local communities, and I am logged in on voyager

Nutomic commented 11 months ago

There was a backend issue where subscribes to local communities would be stuck as "pending". That issue was fixed but didnt make it into the release candidate. What youre describing here might be a different issue, particularly if it happens with remote communities.

Die4Ever commented 11 months ago

It looks to me like this line of code should be using follow: true instead of false, and then below it in the unfollow it should be false instead of true

https://github.com/LemmyNet/lemmy-ui/blob/main/src/shared/components/community/communities.tsx#L188C1-L188C1

dessalines commented 11 months ago

Good catch thx!