⁂ Article
Returning objects in a collection vs. IDs
In another topic (#Smithereen 0.11 is out!), @grishka@mastodon.social says this:
I have this convention where I return IDs for remote objects (obviously, how else would you authenticate them if not by fetching from the origin servers) but complete objects that are local, to save resources. IIRC I saw Mastodon do it for replies so just copied this behavior
In another topic (#Smithereen 0.11 is out!), @grishka@mastodon.social says this:
I have this convention where I return IDs for remote objects (obviously, how else would you authenticate them if not by fetching from the origin servers) but complete objects that are local, to save resources. IIRC I saw Mastodon do it for replies so just copied this behavior
It was in response to a discussion about conversation contexts — a resolvable collection of items that represents a conversation, thread, reply tree, etc.
Most implementors return a collection of object IDs, some return a collection of activities.
What about a mix of object IDs and full objects? That's interesting — it's the first I've heard of it.
My gut reaction is that it's messy... mixing types: strings for some items in the collection and complete objects for others.
... but I think at the end of the day, there are three things we need to acknowledge:
- Most implementors end up converting ids to complete objects anyway by fetching from the remote resource (unless it is not needed)
- Sending additional bytes over the wire is fairly inconsequential (unless I suppose you're sending many Mbits...)
- Including the entire object saves on additional calls if the receiving party does not already know about the object.
- You can trust the objects owned by the server you're requesting data from. (this is fe34)
I wonder if an amendment to f228 is needed @silverpill@mitra.social to capture this use-case?