Hi! sorry i’m very late to this discussion but wanted to contribute my 2 cents.
The AS2 consumer needs to be able to handle any of the following cases:
It’s missing (do nothing)
It’s unresolvable (group by opaque string comparison)
It’s resolvable to something that isn’t a Collection (group by id of that object)
It’s resolvable to a Collection (group by id of that object, and also you can process its items or orderedItems)
This is a good summary but I think it falls short: contexes right now are used for grouping objects in a conversation and it’s very easy to get conflicts.
For example, as of now, mastodon may publish a note #1. It doesn’t use context, sets conversation #abc. pleroma receives that posts and replies #2, processes conversation (because it handles fallbacks) and so #2 has context #abc. misskey may reply #3, but it doesn’t use context at all. pleroma, replying again, will find no context and generate a new one for #4.
Posts #1, #2, #3 and #4 should all be in the same context, as they are “in the same thread”, but because there is no consensus on how this context gets generated, the context field gets inconsistent mid-way and the property itself becomes mostly useless.
I think it’s important to settle for middle ground: having collection contextes would be cool to fetch threads, but it’s ineffective because remote servers need to all be consistent with their context assignation.
I propose a separate approach, and it’s what I’m doing with my software: make context a link to the “first” object. Every reply is “in context of that first note”. This way, in the example from before, pleroma would be able to put the same context in #2 and #4, and potentially even insert a context in #3 from misskey, to be able to grab these notes efficiently from db with just 1 query.
The main value of this proposition is that single softwares can effectively fix contexes from other instances without their contribution, because they know how to fill it. Other proposals require coordination from remote instances to be able to pick a valid context.
Fetching whole conversations is theoretically possible with this model combining the replies collection: upon receiving a note, use its context to go back to the “first note”, and crawl down from there using replies. This is a bit more involved that just having a single paginated collection, but I think the load imposed is comparable since most of the work is fetching the replies themselves rather than the containing collections.
An extension may be introduced to have “thread collections”, and I’d actually be very supportive of that, maybe a thread property? changing context impacts current fediverse software, introducing a new property is opt-in for interested implementations.
Sorry for jumping in so late in the FEP process, hope my 2 cents can be of value, I can say that I’m currently doing this in my software. It’s a bit unfair, as I change remote objects when mirroring them locally, but it’s quite reliable in stitching up threads and allows me to fetch a bunch of replies very quickly!! (: