4
1

So this is currently a thought experiment or brainstorming, whatever...

When a community is local, the "home server" for community, that means that the federation is sent out to subscribed servers.

Now it also means that the total subscribe list is only know to that one server... As least I think it works that way, that the subscribe of "home" server is the complete list and everyone else has partial lists.

There is a lot of the structure of a community that offers some data opportunities to Lemmy. For one, a community object can be edited by any of the moderators. and any moderator can Lock a post, Remove a post, etc.

Reddit has a not-often-used Wiki feature, that even basically means more than one person could edit content too. Other than the sidebar of a community, I don't think Lemmy has any concept of multiple people being able to edit a post or a comment. But again, multiple mods can feature or lock a post... so there is some concept of multiple-actors on data.

I think when you get into creating flair / tags and even playlists (multi-community lists), you want multiple people to be able to edit data. Which in Reddit was the Wiki structure.

i know some of it is kind of a waste of time.. because people tend to avoid Wiki and highly favor posting the same repeat questions and content over and over, reposts. But a man can dream, can't he :)

8
submitted 10 months ago by RoundSparrow@lemmy.ml to c/lemmy_admin@lemmy.ml

cross-posted from: https://campfyre.nickwebster.dev/post/89316

I was getting close to hitting the end of my free object storage so there was time pressure involved haha.

Seems to work but I haven't tested it too much. Currently running on my instance.

10
submitted 10 months ago* (last edited 10 months ago) by RoundSparrow@lemmy.ml to c/rust@programming.dev

Help! I want to divorce ReadFn from ListFN - bypassing the Queries mutual closure behavior so I can better isolate some logic. My need is to get an independent ListFn...

fn queries_<'a>() -> Queries<
  impl ReadFn<'a, PostView, (PostId, Option, bool)>,
  impl ListFn<'a, PostView, PostQuery<'a>>,
> {

Context: https://github.com/LemmyNet/lemmy/blob/main/crates/db_views/src/post_view.rs

For sake of clarity... I'm not wanting to break the whole Queries joined closure marriage project-wide, just this one source file I want to be able to copy/paste this code twice and have just a single closure for ListFn.

Thank you.

[-] RoundSparrow@lemmy.ml 35 points 10 months ago* (last edited 10 months ago)

Most common cause is people changing their language settings in their profile. It's a daily occurrence. The app really needs to tell people "25 messages not displayed because you are only viewing in Spanish".

562
submitted 10 months ago* (last edited 10 months ago) by RoundSparrow@lemmy.ml to c/politics@lemmy.world

Donald Trump faces four indictments, 91 criminal charges and hundreds of years of maximum prison time combined.

This is a former president who — according to the latest grand jury indictment in Fulton County, Georgia — participated in a “criminal enterprise.” Trump and 18 co-defendants are accused of trying “to unlawfully change the outcome of the election” in 2020. Among the 13 felony charges he faces is one count of violating the Georgia RICO (Racketeer Influenced and Corrupt Organizations) Act and two counts of conspiracy to commit forgery.

Most of those charges are related to a fake elector scheme by the Trump campaign in which a slate of “alternate” electors in Georgia would cast electoral votes for Trump instead of Joe Biden. The president of the most powerful democracy in the world allegedly tried to steal an election.

We can’t say it often enough: This is serious. Americans cannot shrug this off or normalize it, no matter how many times Trump gets indicted. Yet it feels like business as usual. Not only is Trump favored to win the GOP presidential nomination, he’s also neck and neck with President Biden in the 2024 general election, according to a July poll by the New York Times/Siena Poll.

MORE THAN A CULT

Trump’s support cannot only be explained as the product of the cult-like power he has over his MAGA base, which accounts for roughly 40% of Republican voters who believe those indictments are nothing but a conspiracy against him.

more: https://www.miamiherald.com/opinion/editorials/article278265068.html

7
submitted 10 months ago* (last edited 10 months ago) by RoundSparrow@lemmy.ml to c/rust@programming.dev

I'm trying to wrangle in and get 'back to basics' with Lemmy's Diesel code and at every turn I run into not understanding the complexity of the Rust code.

You may want to do a GitHub checkout of this branch if you want to see what I'm attempting: https://github.com/LemmyNet/lemmy/pull/3865

I'm basing my experiments off the code in that pull request, which links to this branch on this repository: https://github.com/dullbananas/lemmy/tree/post-view-same-joins

Right now Lemmy's Diesel code spins up many SQL table joins and for an anonymous user it just passes a -1 user id to all the joins - and it really makes for difficult to read SQL statements. So I decided to experiment with removing as much logic as I could to get the bare-bones behavior on generating the desired SQL statement....

I copied/pasted the queries function/method and gave it a new name, kept removing as much as I could see that referenced the user being logged-in vs. anonymous, and got to this point:

fn queries_anonymous<'a>() -> Queries<
  impl ReadFn<'a, PostView, (PostId, Option, bool)>,
  impl ListFn<'a, PostView, PostQuery<'a>>,
> {
  let is_creator_banned_from_community = exists(
    community_person_ban::table.filter(
      post_aggregates::community_id
        .eq(community_person_ban::community_id)
        .and(community_person_ban::person_id.eq(post_aggregates::creator_id)),
    ),
  );

// how do we eliminate these next 3 assignments, this is anonymous user, not needed

  let is_saved = |person_id_join| {
    exists(
      post_saved::table.filter(
        post_aggregates::post_id
          .eq(post_saved::post_id)
          .and(post_saved::person_id.eq(person_id_join)),
      ),
    )
  };

  let is_read = |person_id_join| {
    exists(
      post_read::table.filter(
        post_aggregates::post_id
          .eq(post_read::post_id)
          .and(post_read::person_id.eq(person_id_join)),
      ),
    )
  };

  let is_creator_blocked = |person_id_join| {
    exists(
      person_block::table.filter(
        post_aggregates::creator_id
          .eq(person_block::target_id)
          .and(person_block::person_id.eq(person_id_join)),
      ),
    )
  };

  let all_joins = move |query: post_aggregates::BoxedQuery<'a, Pg>, my_person_id: Option| {
    // The left join below will return None in this case
    let person_id_join = my_person_id.unwrap_or(PersonId(-1));

    query
      .inner_join(person::table)
      .inner_join(community::table)
      .inner_join(post::table)
// how do we eliminate these next 3 joins that are user/person references?
      .left_join(
        community_follower::table.on(
          post_aggregates::community_id
            .eq(community_follower::community_id)
        ),
      )
      .left_join(
        community_moderator::table.on(
          post::community_id
            .eq(community_moderator::community_id)
        ),
      )
      .left_join(
        post_like::table.on(
          post_aggregates::post_id
            .eq(post_like::post_id)
        ),
      )
      .left_join(
        person_post_aggregates::table.on(
          post_aggregates::post_id
            .eq(person_post_aggregates::post_id)
        ),
      )
      .select((
        post::all_columns,
        person::all_columns,
        community::all_columns,
        is_creator_banned_from_community,
        post_aggregates::all_columns,
        CommunityFollower::select_subscribed_type(),
// how do we eliminate these next 3 for anonymous?
        is_saved(person_id_join),
        is_read(person_id_join),
        is_creator_blocked(person_id_join),
        post_like::score.nullable(),
        coalesce(
          post_aggregates::comments.nullable() - person_post_aggregates::read_comments.nullable(),
          post_aggregates::comments,
        ),
      ))
  };

  let read =
    move |mut conn: DbConn<'a>,
          (post_id, my_person_id, is_mod_or_admin): (PostId, Option, bool)| async move {

      let mut query = all_joins(
        post_aggregates::table
          .filter(post_aggregates::post_id.eq(post_id))
          .into_boxed(),
        my_person_id,
      );

        query = query
          .filter(community::removed.eq(false))
          .filter(post::removed.eq(false))
          ;

      query.first::(&mut conn).await
    };

  let list = move |mut conn: DbConn<'a>, options: PostQuery<'a>| async move {
    let person_id = options.local_user.map(|l| l.person.id);

    let mut query = all_joins(post_aggregates::table.into_boxed(), person_id);


      query = query
        .filter(community::deleted.eq(false))
        .filter(post::deleted.eq(false));


    // every SELECT has to labor away on removed filtering
      query = query
        .filter(community::removed.eq(false))
        .filter(post::removed.eq(false));

    if options.community_id.is_none() {
      query = query.then_order_by(post_aggregates::featured_local.desc());
    } else if let Some(community_id) = options.community_id {
      query = query
        .filter(post_aggregates::community_id.eq(community_id))
        .then_order_by(post_aggregates::featured_community.desc());
    }

    if let Some(creator_id) = options.creator_id {
      query = query.filter(post_aggregates::creator_id.eq(creator_id));
    }


    if let Some(url_search) = options.url_search {
      query = query.filter(post::url.eq(url_search));
    }

    if let Some(search_term) = options.search_term {
      let searcher = fuzzy_search(&search_term);
      query = query.filter(
        post::name
          .ilike(searcher.clone())
          .or(post::body.ilike(searcher)),
      );
    }

      query = query
        .filter(post::nsfw.eq(false))
        .filter(community::nsfw.eq(false));


    query = match options.sort.unwrap_or(SortType::Hot) {
      SortType::Active => query
        .then_order_by(post_aggregates::hot_rank_active.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::Hot => query
        .then_order_by(post_aggregates::hot_rank.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::Controversial => query.then_order_by(post_aggregates::controversy_rank.desc()),
      SortType::New => query.then_order_by(post_aggregates::published.desc()),
      SortType::Old => query.then_order_by(post_aggregates::published.asc()),
      SortType::NewComments => query.then_order_by(post_aggregates::newest_comment_time.desc()),
      SortType::MostComments => query
        .then_order_by(post_aggregates::comments.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopAll => query
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopYear => query
        .filter(post_aggregates::published.gt(now - 1.years()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopMonth => query
        .filter(post_aggregates::published.gt(now - 1.months()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopWeek => query
        .filter(post_aggregates::published.gt(now - 1.weeks()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopDay => query
        .filter(post_aggregates::published.gt(now - 1.days()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopHour => query
        .filter(post_aggregates::published.gt(now - 1.hours()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopSixHour => query
        .filter(post_aggregates::published.gt(now - 6.hours()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopTwelveHour => query
        .filter(post_aggregates::published.gt(now - 12.hours()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopThreeMonths => query
        .filter(post_aggregates::published.gt(now - 3.months()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopSixMonths => query
        .filter(post_aggregates::published.gt(now - 6.months()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
      SortType::TopNineMonths => query
        .filter(post_aggregates::published.gt(now - 9.months()))
        .then_order_by(post_aggregates::score.desc())
        .then_order_by(post_aggregates::published.desc()),
    };

    let (limit, offset) = limit_and_offset(options.page, options.limit)?;

    query = query.limit(limit).offset(offset);

    debug!("Post View Query: {:?}", debug_query::(&query));

    query.load::(&mut conn).await
  };

  Queries::new(read, list)
}

This compiles, but I can not progress further. There are 3 joins more that aren't really needed for an anonymous user... but the interdependent Rust object structures I can't unravel enough to remove them from the code.

For example, Lemmy allows you to "save" a post, but an anonymous user doesn't have that ability - so how can I remove the JOIN + select related to that while still satisfying the object requirements? I even tried creating a variation of PostViewTuple object without one of the bool fields, but it all cascades into 50 lines of compiler errors. Thank you.

4
4
17
submitted 10 months ago by RoundSparrow@lemmy.ml to c/lemmydev@lemm.ee

cross-posted from: https://lemmy.world/post/3252643

lemmy.readme.io uploaded some great API documentation to get started making your own Lemmy client.

Proved very useful in making my iOS client Lunar

12
submitted 10 months ago* (last edited 10 months ago) by RoundSparrow@lemmy.ml to c/youtube@lemmy.ml
397
submitted 10 months ago by RoundSparrow@lemmy.ml to c/worldnews@lemmy.ml
185
submitted 10 months ago by RoundSparrow@lemmy.ml to c/worldnews@lemmy.ml
[-] RoundSparrow@lemmy.ml 30 points 11 months ago

Up until now, social containers like groups, communities, or subreddits on all the largest social networks have existed as fundamentally separate locations on a single hierarchical level.

"Up until now"... Uh... no, Usenet... was the open standard for social media. Created in 1979. A foundation of the Internet. Just as much as e-mail was.

alt.tv.simpsons
alt.tv.futurama

[-] RoundSparrow@lemmy.ml 110 points 11 months ago* (last edited 11 months ago)

s in the past hour

Since Saturday lemmy.ml and lemmy.world were not sending content correctly. The problem seems cleared up now.

[-] RoundSparrow@lemmy.ml 27 points 11 months ago

the module can cause intermittent stuttering, depending on which Ryzen processor you're using. It appeared when the fTPM was in use, it would access its flash storage via a serial interface, and when doing so, held up activity by the rest of the system.

[-] RoundSparrow@lemmy.ml 106 points 11 months ago

A reminder to move to smaller instances for a better experience

A reminder that this constant advice people blindly parrot to install and flock to smaller instance has now created something like 1000 new servers in 50 days that are poorly run and already going offline as quickly as they went online.

Github Issue 2910 is the kind of PostgreSQL problems that the developers ignored for months and people still defend the developer choices to have the code doing real-time counting of every single comment and post for numbers nobody needs to needs done in real-time.

PostgreSQL is voodoo to this project, they do everything they can to avoid going to !postgresql@lemmy.ml community and asking for help, learning 101 about how to fix their SQL TRIGGER logic like Github Issue 2910 spelled out June 4.

[-] RoundSparrow@lemmy.ml 20 points 11 months ago* (last edited 11 months ago)

I turn the question around... people who are clearly liars, deceivers... politicians and businessmen that people line up to vote for with their money or public votes. You really wonder what people think an "asshole" is when you see the kind of politicians that get massive support in a population - to a point people have their photograph on the wall of their workplace or home, put stickers on their cars, etc. to support people that are clearly monstrous. A lot of people do not seem to like to study the crowds of Europe 1930's terrible leaders and just how many lined up to cheer on such persons.

The scientists a person believes also is a huge indicator of who they consider to be an 'asshole'. Just passively listening to people who support denial of climate change, denial of microscopic germs and virus, etc. The enthusiasm that followers to non-factual science seem to be very high, and they draw crowds in ways that fact-based science does not seem to do.

[-] RoundSparrow@lemmy.ml 29 points 11 months ago* (last edited 11 months ago)

It’s not on every comment,

My testing with latest code is that it is indeed on every single comment INSERT, every new comment. I have the ability to view my live data while using Lemmy: https://lemmyadmin.bulletintree.com/query/raw_site_aggregates?output=table

Every one of the 1486 rows on that table gets +1 on comment when I post a new comment on my instance.

it’s mostly triggered on deletions and edits

That is not correct. Edits do not change the count of comments column on site_aggregates - because the number isn't changing. Deletes (of a comment or post) in Lemmy are also not SQL DELETE statements, they are just a delete data column in the table. That DELETE PostgreSQL trigger only gets run when a end-user cancels their Lemmy account in their profile.

[-] RoundSparrow@lemmy.ml 23 points 11 months ago

The project had gone on for 4 years without a lot of testing... old code like login form had all kinds of problems, etc. Lemmy-ui had almost no ability to cope with errors from the backend, and often error messages didn't even exist for the API calls. There was a huge rush to fix so many areas that were outright not working.

[-] RoundSparrow@lemmy.ml 24 points 1 year ago

Great, thank you. The network is much more stable and working solid!

[-] RoundSparrow@lemmy.ml 53 points 1 year ago* (last edited 1 year ago)

Query speed is Lemmy’s main performance bottleneck, so we really appreciate any help database experts can provide.

I have been pleading that Lemmy server operators install pg_stat_statements extension and share metrics from PostgreSQL. https://lemmy.ml/post/1361757 - a restart of PostgreSQL server is required for the extension to be installed. I suggest this be part of 0.18 upgrade. Thank you.

[-] RoundSparrow@lemmy.ml 35 points 1 year ago* (last edited 1 year ago)

I don't think people know (how end-users will cope with the distributed choices of Lemmy). Reddit 2023 is nothing at all like Lemmy. One could be considered a household name for regular users of the Internet, the other a return to something more like FidoNet.

I come from the BBS days of the early 1980's and even social media radio before that. I come from IRL user group meetings, held at public library and after-hours company meeting rooms. It has always bothered me that current-day subreddits have mostly no identity to the moderators and that moderation is often behind the scenes.

I guess it's like "corporate experience" that people expect this day in society... that you can walk into a generic franchise chain bar and grill and not really care who the owner/operator and bouncers are of your hangout. Anyone can start a topic/ conversation and there is just some anonymous janitorial crew who is supposed to clean up the overflowing mess if (non-venue) spam or hate messages enter into the space.

The mechanisms of who pays for the venue and the moderators also was a topic most people never bothered to think about. Like it was some taxpayer-funded city park and perhaps the admin police might spot check if anyone was causing a tragedy in that there commons. But reality is that it was a profit-seeking venue charging a cover charge in the form of selling copies of your contribution and changing the tone of your meeting space by controlling the jukebox that visitors hear in terms of advertising messages inserted into the conversation space.

Lemmy seems small, owner/operator focused, and you get a sense that each instance is like some small bar and grill where you can come and meet some strangers or friends to discuss some topics under house rules. Your tips help pay for the hosting and the jukebox isn't piped in memes from advertisers.

I remember when Reddit had known owners with known ideals, but that was very long ago. I've found making it big (with the associated wealth) changes people. One owner even committed suicide over his society ideals about sharing information. Ultimately I feel like a lack of topic participation by the moderators and owners alike made people thoughtless as to their own role in building a human community and people often felt like they were fighting machines and code.

sorry if this meandered off topic, but lately I've had some long-time friends ask me 'what is Reddit" since it is in the news lately, and I find it hard to explain what Reddit used to be (before new Reddit and the addition of images/video) vs. the corporate-like entity we know today that our contributions and participation helped empower over the past 17 years. I've used it mostly daily for all that time, and I have been unhappy with society's dehumanizing direction for too many years.

/ramble from a disturbed mind.

view more: next ›

RoundSparrow

joined 1 year ago
MODERATOR OF