Update Activity on remote object

In ActivityPub C2S, the client sends a partial update, which the server applies on top of the object being updated.

What if you want to update an object that is hosted remotely, on a different server? Does a partial update make sense there?

Options:

  1. Partial update, server applies the update to a locally cached version of the remote object
  2. Partial update, server HTTP GETs remote object and applies update to it
  3. Full update, client is responsible for sending the server the full object

Option 3 makes the most sense to me. If the client does the update based on a view of the object that it got by HTTP GETing it (which is the common case to expect?), then a full update would safely preserve the author’s intentions.

Thoughts?

could we safely treat full updates as a special case of partial updates? (using null to specifically signal removing a property). the only possible downside I can see is that if the remote object has a property the local client doesn’t know about (through race conditions or incompatibility or whatever), it’s not removed. that seems like a plus to me

Update in federation should contain the complete object so that the server receiving it is guaranteed to have a consistent state

Unfortunately, there doesn’t seem to be a protocol guarantee of any feature that could reliably guarantee a proper determination of precedence if multiple updates were received

Maybe Update should be required to be inReplyTo to the previous state? (So Create→Update 1→Update 2→…)

As for the partial vs. full copy, this is quite addressed in https://www.w3.org/TR/activitypub/#partial-updates

1 Like

Wouldn’t this overwrite any original inReplyTo metadata?

Nah, Activity/Object separation allows it.

{
  "type": "Create",
  "id": "https://example.org/ben/1337-create",
  "object": {
    "id": "https://example.org/ben/1337-note",
    "type": "Note",
    "content": "Who else loves chocolates?"
  }
}
{
  "type": "Update",
  "id": "https://example.org/ben/1338-update",
  "inReplyTo": "https://example.org/ben/1337-create",
  "object": {
    "type": "Note",
    "id": "https://example.org/ben/1337-note",
    "content": "Who else hates babies?"
  }
}

Would still give the following object (and I’m assuming Create is unmodified in this implementation):

{
  "type": "Note",
  "id": "https://example.org/ben/1337-note",
  "content": "Who else hates babies?"
}
1 Like