A number of posts have 50+ downvotes, what is happening again, didn’t we solve this?

  • @sub_ubi
    link
    8
    edit-2
    1 year ago

    ^ a good reason to make who voted visible on the frontend.

    • Looking at the types returned from the API, this would be a nontrivial task. There are 2 types I’ll call your attention to. First is PostView:

      export interface PostView {
        post: Post;
        creator: Person;
        community: Community;
        creator_banned_from_community: boolean;
        counts: PostAggregates;
        subscribed: SubscribedType;
        saved: boolean;
        read: boolean;
        creator_blocked: boolean;
        my_vote?: number;
        unread_comments: bigint;
      }
      

      The second is PostAggregates:

      export interface PostAggregates {
        id: number;
        post_id: PostId;
        comments: bigint;
        score: bigint;
        upvotes: bigint;
        downvotes: bigint;
        published: string;
        newest_comment_time_necro: string;
        newest_comment_time: string;
        featured_community: boolean;
        featured_local: boolean;
      }
      

      You’ll notice on the PostAggregates type, the only information on votes are upvotes, downvotes, and score. The only information you get as to who voted on what is my_vote on PostView. Since these types are what end up getting sent to the frontend, showing who voted on each post to everyone would require work on the backend as well. If you’re interested in seeing it added as a feature, you should open an issue on lemmy’s github.

    • Honestly I don’t see a reason to not implement this. Other ActivityPub projects show a list of who repeated, favorited and reacted to a post if you click on it and many Internet forums I’ve come across do the same.