Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
julian
@julian@activitypub.space  ·  activity timestamp 3 weeks ago

⁂ 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:

  1. Most implementors end up converting ids to complete objects anyway by fetching from the remote resource (unless it is not needed)
  2. Sending additional bytes over the wire is fairly inconsequential (unless I suppose you're sending many Mbits...)
  3. Including the entire object saves on additional calls if the receiving party does not already know about the object.
  4. 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?

  • Copy link
  • Flag this article
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.13 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login