publish: support multi-type posts (not planned) · Issue #832 · snarfed/bridgy (original) (raw)

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: