Post deletions and their potential to break threads

Suppose this happens: (users A and B are on the same instance)

  1. User A creates a post.
  2. User B replies to that post.
  3. User A replies to that reply.
  4. User B deletes their first reply.
  5. User B replies to user A’s reply and mentions the user C who is from another instance that doesn’t have any of these posts in its database.

You end up with something like this, except the “test comment” is deleted:


The issue: when user C’s instance receives a Create activity about the last reply and goes to fetch the complete thread, it can’t. The idea is that you would follow inReplyTo references up, until you encounter an object without this field, which means you’ve reached the top-level post. But if there is any deleted object along the way, you kind of hit a wall and don’t have any way of getting to the top-level post and thus completing your representation of the comment thread. Or do you? I’ve just tested with Mastodon and it doesn’t even return a Tombstone, it acts as if the post didn’t ever exist by returning a 404. Anyway, any ideas on solving this?

Related: going in the opposite direction, down from the top-level post, you have the exact same issue but with the replies collection.

1 Like

I solved exactly the same issue developing a Client app. And such cases occur not only when a note is deleted: we encounter the same case, when some post in the thread is not visible at our side. E.g. because an instance, from which that note was sent, does not communicate with our system (doesn’t work properly, is not configured to communicated with us, etc…)
In such cases I use “conversation” or “context” references (references to a collection of activities of this thread), if such exists.
Creation (and possible merging / linking…) of such “conversation” IDs is a separate not trivial task…

Seeing different (numbers of) activities from different instances is a known problem of GNU Social and Mastodon, (cited from ):

I know these causes of such differences:

  1. Messages of a remote User are delivered to an instance (and hence can be retrieved as a part of a conversation) only if this User is followed by at least one User of this instance.
  2. Mastodon adds another restriction: a message can have an “instance scope” I.e. it cannot be sent to any other instance.
  3. And of course, there are sync problems between different instances. E.g. some days ago I’ve heard that there were problems in message communication between Mastodon and GNU Social instances…

To clarify: this is not a Mastodon feature, but there are various third-party forks of Mastodon that do provide this feature.

1 Like

I ended up doing this:

  "@context": "",
  "type": "Tombstone",
  "formerType": "Note",
  "url": "http://smithereen.local:8080/posts/114",
  "id": "http://smithereen.local:8080/posts/114",
  "inReplyTo": "http://smithereen.local:8080/posts/113",
  "replies": {
    "id": "http://smithereen.local:8080/posts/114/replies",
    "type": "Collection",
    "first": {
      "next": "http://smithereen.local:8080/posts/114/replies?offset=0&count=50",
      "partOf": "http://smithereen.local:8080/posts/114/replies",
      "type": "CollectionPage",
      "items": []

If a post gets deleted, either locally or by a Delete activity, and there are replies to it, I don’t delete the DB row completely but rather null most of it, keeping the fields needed to keep the thread intact.