Comment on Introducing New Fediverse Software, Goofed v0.0.1, Minimum Viable Shitpost Edition
rimu@piefed.social 3 days ago
That sounds pretty fun, I like your extremist take on things.
If you want to federate votes in an efficient way, consider doing them in batches, like this - https://codeberg.org/rimu/pyfedi/src/branch/main/docs/fep-4248.md. Sending batches means building up a queue, etc which is a pain in the ass so you might want to just receive batches and send individually.
You can do nested comments more efficiently by doing a single query for all the comments on a post and then constructing the comment tree in Go, rather than using multiple SQL queries. It’s a bit tricky to code but you can copy PieFed’s code - https://codeberg.org/rimu/pyfedi/src/commit/68d6799be5c321f9abf84d136cafef6de6e3aafb/app/post/util.py#L141
admin@scrapetacular.ydns.eu 3 days ago
Whoa senpai noticed me. There actually is a recursive query format in the latest sqlite for this exact situation, Postgres may have something similar, I just thought a list is fine for the web UI. I’ll have to benchmaxx and pick a strategy for the API.
I actually read that FEP. In my code that is too shameful to release yet, I look for an Object, then look for its Type, then figure out how to deserialize the rest of the object, but this object doesn’t have one. Would it be possible to do something like this:
Or is that weird. Spare a thought for those in less dynamic languages :D
rimu@piefed.social 3 days ago
You’re right, to be more similar to the ActivityPub style of doing things the object should be a “type” of “Collection”, not just suddenly be an array instead of an object.
admin@scrapetacular.ydns.eu 2 days ago
How do you know if a random server implements a particular FEP?
rimu@piefed.social 2 days ago
There is a convention of putting a FEDERATION.md file in the root of your project (there is a FEP about it but I can’t remember what it is, heh) which lists the FEPs your project implements.
e.g. https://codeberg.org/rimu/pyfedi/src/branch/main/FEDERATION.md
There is no standardised API endpoint for discovering this info so basically you just need to lurk in all the dev spaces you can and watch what they’re talking about, stalk each other’s codeberg/github issue queues and PRs and just cope with the jank.
admin@scrapetacular.ydns.eu 3 days ago
Shit, that went well, I was expecting pushback. Should I make an issue for discussion, or is there one already. I don’t know if the object also needs an ID
rimu@piefed.social 3 days ago
There is a discussion but it’s an email chain between myself, Lemmy, Mbin, NodeBB so not really out in the open.
I’m thinking of using the normal OrderedCollection structure that AP has - https://www.w3.org/TR/activitystreams-vocabulary/#dfn-orderedcollection. An object of type ’OrderedCollection’ with an array of ‘items’.