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

[Bug]: Trying to subscribe to a non-local instance always returns not subscribed #3384

Closed
4 tasks done
SleeplessOne1917 opened this issue Jun 27, 2023 · 1 comment
Closed
4 tasks done
Labels
bug Something isn't working

Comments

@SleeplessOne1917
Copy link
Member

Requirements

  • Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • Did you check to see if this issue already exists?
  • Is this only a single bug? Do not put multiple bugs in one issue.
  • Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Summary

This was originally opened as a UI issue. After some digging, the issue appears to be on the backend.

I tested this out by using the js client to make a request with my account.

import { LemmyHttp } from "lemmy-js-client";

const client = new LemmyHttp("https://lemmygrad.ml");

const doStuff = async () => {
  const { jwt } = await client.login({
    password: "REDCATED",
    username_or_email: "REDACTED",
  });

  const res = await client.followCommunity({
    auth: jwt ?? "",
    community_id: 258,
    follow: true,
  });

  console.log(res);
};

doStuff();

This request tries to follow ask lemmy on lemmy.ml from a lemmygrad account. This is the response I get back:

{
  community_view: {
    community: {
      id: 258,
      name: 'asklemmy',
      title: 'asklemmy',
      description: 'A loosely moderated place to ask open ended questions\n' +
        '\n' +
        'If your post is\n' +
        '\n' +
        '1. Open ended \n' +
        '2. Not offensive (At this point, I do not have the bandwidth to moderate partisan political discussions)\n' +
        '3. **Not regarding lemmy support** ([!lemmy_support@lemmy.ml](https://lemmy.ml/c/lemmy_support) )\n' +
        '4. not ad nauseam inducing (please make sure its a question that would be new to most members)\n' +
        '5. [An actual topic of discussion](https://lemmy.ml/post/1239589)\n' +
        '\n' +
        'it’s welcome here!',
      removed: false,
      published: '2019-04-25T04:58:33.886275',
      updated: '2023-06-14T00:05:37.871496',
      deleted: false,
      nsfw: false,
      actor_id: 'https://lemmy.ml/c/asklemmy',
      local: false,
      icon: 'https://lemmy.ml/pictrs/image/UsuGsKF2fl.png',
      banner: 'https://lemmy.ml/pictrs/image/XKAjSZCX2P.png',
      hidden: false,
      posting_restricted_to_mods: false,
      instance_id: 339
    },
    subscribed: 'NotSubscribed',
    blocked: false,
    counts: {
      id: 204,
      community_id: 258,
      subscribers: 180,
      posts: 1773,
      comments: 33852,
      published: '2019-04-25T04:58:33.886275',
      users_active_day: 911,
      users_active_week: 3618,
      users_active_month: 7815,
      users_active_half_year: 7986,
      hot_rank: 0
    }
  },
  discussion_languages: []
}

Notice that subscribed is NotSubscribed.

Compare this to when I try to subscribe to a local community:

{
  community_view: {
    community: {
      id: 3957,
      name: 'leftistunix',
      title: 'Linux for Leftists',
      description: 'A Community for all leftists wanting to join and being part of a community that talks about Linux, Unix and the Open-Source Community',
      removed: false,
      published: '2021-04-14T06:10:46.277451',
      updated: '2023-06-24T10:32:37.868872',
      deleted: false,
      nsfw: false,
      actor_id: 'https://lemmygrad.ml/c/leftistunix',
      local: true,
      icon: 'https://lemmygrad.ml/pictrs/image/f0056071-6839-4146-9742-374509ee5fd9.png',
      banner: 'https://lemmygrad.ml/pictrs/image/34095db5-670e-45ba-957c-745ec014abe5.jpeg',
      hidden: false,
      posting_restricted_to_mods: false,
      instance_id: 42
    },
    subscribed: 'Subscribed',
    blocked: false,
    counts: {
      id: 374,
      community_id: 3957,
      subscribers: 532,
      posts: 65,
      comments: 735,
      published: '2021-04-14T06:10:46.277451',
      users_active_day: 2,
      users_active_week: 12,
      users_active_month: 61,
      users_active_half_year: 79,
      hot_rank: 0
    }
  },
  discussion_languages: []
}

Subscribed is subscribed, as expected.

Steps to Reproduce

  1. Go to community hosted on an instance other than your own.
  2. Try to subscribe to it.
  3. There is no subscribe button, just the text "Subscribe".

Technical Details

I could not reproduce this locally and I do not have access to the logs of affected instances.

Version

0.18

Lemmy Instance URL

programming.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants