Search code examples
getstream-io

Ambiguous activity format cases


I'm not totally clear on how to stick to the suggested activity spec in a few cases, most of which map to something like this:

  • Eric left a comment "hello" on the topic "hey" on the album "hi"

The actor and the verb are clear, but I'm not clear on the object or target. Is the text of the comment the object and topic the target and the album extraneous metadata?


Solution

  • In this case, object is the comment, and target is the album.

    Eric left a comment "hello" on the topic "hey" on the album "hi"

    • Actor: Eric (Eric's ID in your data store)
    • Verb: "commented"
    • Object: Eric's comment, "hello" (the ID of the comment in your data store)
    • Target: Album "hi" (the ID of the album in your data store)

    Note that this doesn't include 'topic' - depending on how you have your feed groups set up, 'topic' might be another feed that you use the to field to write to (docs: https://getstream.io/docs/#targetting), or 'topic' might be the target.

    It sounds like 'topic' might be a topic that would be shared across a bunch of different albums, so I'm treating that more like a 'category'. In that case, 'album' would still be the target, and 'topic' would be a feed that you also write to using the to field.

    Hopefully that helps clear it up! Let me know how else I can help.