Skip to content

publish: support multi-type posts (not planned) #832

Description

@snarfed

cc @tantek @kartikprabhu. experimental use case: https://indieweb.org/tag-reply#tag_and_comment

the difficulty is, when we convert to AS1 internally, we need to represent it as both a reply and a tag-of, and AS1 doesn't really handle multiple types (or objects) in a single activity: http://activitystrea.ms/specs/json/1.0/#activity , http://activitystrea.ms/specs/json/1.0/#rfc.section.3.4 . that's fine, i can make granary handle multiply valued objectType and verb, it'll just take some work.

in the short term , the more likely answer is that i'll fail fast with a nicer human readable error instead of crashing.

IRC discussion (and earlier). stack trace from the log:

Traceback (most recent call last):
  at json_to_object (/base/data/home/apps/s~brid-gy/8.410945048477799522/local/lib/python2.7/site-packages/granary/microformats2.py:463)
    obj = microformats2.json_to_object(item)
  at attempt_single_item (/base/data/home/apps/s~brid-gy/8.410945048477799522/publish.py:355)
    assert not obj.get('object')
AssertionError

simplified mf2:

{
  "type": ["h-entry"],
  "properties": {
    "tag-of": [{"value": "https://a/post"}],
    "in-reply-to": [{"value": "https://another/post"}],
  }
}

possible AS1 that we could convert it to:

{
  "objectType": ["activity", "comment"],
  "verb": "tag",
  "target": {"url": "https://a/post"},
  "inReplyTo": {"url": "https://another/post"},
}

activity is a qualitatively different object type than comment, so combining them like this is really awkward, and i don't know how to indicate that the tag verb only applies to activity. i expect these and other problems are why AS1 made them singly valued in the first place. :trollface:

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions