RoundSparrow

joined 2 years ago
 

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

 

I'm starting lemmy-ui with:

LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy-alpha:8541 node dist/js/server.js

Running against the drone-lemmy instances created by lemmy_server's api-tests scripts. I'm running latest main checkout on both projects.

My browser gives me:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:8536/api/v3/community/list?type_=Local&amp%3Bsort=TopMonth&amp%3Blimit=50&amp%3Bpage=1. (Reason: CORS request did not succeed). Status code: (null).

api-tests scripts build dev mode, I thought CORS was turned off? I've played around with adding LEMMY_CORS_ORIGIN=* - but it doesn't help.

EDIT: reading this post closer, I see 8536 vs. 8541. If I manually refresh my browser against lemmy-ui on port 1234, it works... but I wonder where 8536 is getting picked up?

Thank you and I hope you are having a great weekend.

 

Someone was asking about it in support, so I was curious to try it. The Rust code has HideCommunity, I even tried to bypass the JavaScript client and do a direct API call.

Does anyone see the function call to send a HideCommunity object?

Where it might be disabled in the Rust code? I know it goes all the way into the database and is on SELECT statements.

Thank you

 

For lemmy server testing and performance baseline measurement, I think it would be cool to have every API call exercised.

Anyone willing to create and share some JavaScript client code? Normally these are run with Jest via NodeJS - but we can make it an extra step to integrate into Jest. I'm just thinking someone doing front-end app work can do a well organized hit on every API surface.

You can skip the creation of a user if you want, that code is already in the testing

Probably ideal to organize moderator vs non-moderator.

Something like: edit profile with every option one at a time, create a community, edit it, create posts, edit, delete, undelete, reply, etc. Imagine you were doing interactive tests of a major upgrade and wanted to hit every feature and button.

Right now most of that testing is done in independent scripts, such as a user test: https://github.com/LemmyNet/lemmy/blob/main/api_tests/src/user.spec.ts

And you can see it only tests editing a profile is working, not that actual features change their behavior. Although I've started to add that for back-end behaviors like showing read/unread posts on the list. Front-end devs are the ones who know what end-users do and the fringe cases to look out for. Thank you.

 

Is .moderators supposed to be on GetCommunity() result? I can't seem to find it in lemmy_server api_tests context. All I'm getting is languages and community_view

EDIT: Wait, so there is a "CommunityResponse" and a "GetCommunityResponse", object? What call do I use to Get a GetCommunityResponse object?

https://github.com/LemmyNet/lemmy-js-client/blob/2aa12c04a312ae4ae235f6d97c86a61f58c67494/src/types/GetCommunityResponse.ts#L7

 

Cite: 1,3xx Lemmy servers federating https://join-lemmy.org/instances

The code in Lemmy does not seem to federate to all the subscribed servers when a end-user on a remote server deletes their own comment. So far, I can't determine if it has always been this way and nobody noticed, or if something broke at some point in Lemmy code changes. Has it been gong on for weeks, or did it always fail?

Please be kind to users, they may have intended to delete their own comment and Lemmy isn't properly removing it on over 1000 servers and only removes it on 2 servers.

This happens when a community is homed on a server different from the server the end-user is commenting (and deleting that comment) on.

Growing pains.

GitHub issue: https://github.com/LemmyNet/lemmy/issues/3625

 

I've been spot-checking consistency of replication between servers by looking at the same community on two Lemmy instances, sorting posts by new.

!asklemmy@lemmy.ml is one of the most active communities and people frequently use it incorrectly, asking technical questions about Lemmy instead of "asking the Lemmy community" for their feedback on a topic.

In spot-checking Lemmy servers, it seems that the moderator removal of the posting is only working on the "home" server, Lemmy.ml - and other servers still show the posting in the New sort list (and I assume other sort choices? unverified).

I opened a GitHub issue about the problem: https://github.com/LemmyNet/lemmy/issues/3535

I also thought this would be a good place to raise the topic. Did anyone recall ever testing and spot-checking that moderation removal of a posting worked on multiple servers before?

Thank you.

 

Reddit seems to really have shifted over the decades to promote throwaway accounts with no lasting identity. You regularly see users casually mention that their previous account was banned and they were using a new account.

The culture where people even black out the account name of Twitter postings when sharing a Tweet screenshot also seemed ridiculous. Like the assumption that every posting was a witchhunt when someone was just sharing an amusing Tweet. With TikTok it was even more absurd, you could see the video of a human person - but not share their TikTok account names.

It left a situation where Rich and Famous people would have their names left in Twitter screen shots, but everyday netizens had theirs blacked out. What are they thinking over there? "Stand up for the Big Guy"?