I don’t have time for this, I’ve used up my time for the month on scaling problem of busy server crashing, without getting the logs out of the busy servers…
So the incoming HTTP API is here:
A Like (Upvote) on a Comment seems pretty direct to follow in code, and apub is chained to all these transactions?
When an API request comes in, I’m assuming it is an HTTP process receiving a connection over TCP/IP and spawning a process to execute code.
So when a comment comes in, creation of a new comment by a client… How much of that process is doing the work with the database, federation queue, etc?
In the middle of this code, i see a Like (Upvote) is created as a step in the creation of a comment: https://github.com/LemmyNet/lemmy/blob/e63aa80c3a3631f4713525d65c8223e1106355e8/crates/apub/src/activities/create_or_update/comment.rs#L186
I’m already into Federation crates with this code, “apub”, so I can go into the federation sharing of the comment or back earlier where the API got the request to create a comment.
Comment save seems direct, is this database only? Where is federation tied in? I see this has the client JWT for session.
A comment like seems like (Upvote) a lot of work: https://github.com/LemmyNet/lemmy/blob/main/crates/api/src/comment/like.rs
Why can’t you upvote a zero-vote comment? Code needs commenting.
A database delete is performed regardless if first comment or not.