@p @silverpill >Yeah, I don't think the way Pleroma does it is optimal, but I think there'd be less DB contention if they were fetched separately, even client-side...
The way a lot of the processing is currently written requires the preloading, because it goes through a bunch of Object.normalize calls when doing basically anything with the data. Not ideal in all situations, but fixing it requires quite a lot of refactoring.
This is completely my guess, but the reason why everything is built around fetching the top-level Activity instead of the Object is ActivityPub being a disfunctional protocol. If you want to do things like domain filtering for timelines, or user blocks on the DB level, you cannot rely on the Object representation to help you with that entirely.
attributedTo is entirely useless in indicating what user made an Object, Activity Vocabulary has this helpful description of its almost-uselessness:
Identifies one or more entities to which this object is attributed. The attributed entities might not be Actors. For instance, an object might be attributed to the completion of another activity.
And ActivityPub says only this about that:
When a Create activity is posted, the actor of the activity SHOULD be copied onto the object's attributedTo field.
So your only way of figuring out what user made the Object is looking at the Activity's actor.
>"Here's an array, why's it an array? It's not an array in any activity except one." (And, you know, you have to account for this kind of thing even if it's one activity because you don't want to fall over instead of just rejecting it.
Yep, I've fixed a couple of those on the Pleroma AP normalization side. Some server with no source available (dead for over a year probably) sent avatars and banners as an array for some reason, which then crashed the MastoAPI search side when it came across that. I wish AP developers didn't have the paradigm of shitting out technically compliant random bullshit and have everyone else deal with normalizing it to something sane, the robustness principle fallacy.