Search code examples
getstream-io

Are stream hierarchies possible in Getstreams.io?


We're building an application in which user can upload lists of pages, can leave notes on those pages, and people can discuss these notes. A user may choose to get notified for all replies on all notes on a page, which could all be separate activity streams. Or for all discussions on all pages in a list of pages (which can be many.)

Would it be possible to let a list follow all its pages, and a page all its notes, so that a user can follow a page or a list and receive all the relevant updates?


Solution

  • That's possible.

    However, follow relationship gets activities from direct connections. For hierarchy, to targeting should be used.

    When an activity is added to a note, it will be captured by the page since page follows it and if project follows pages, it won't get the activity but while adding an activity to a note you can add project as notified too.

    Change is minimal, add to key to activity payload with feeds you want to copy it:

    {
      verb: 'comment',
      ...
      to: ['project:mine']
    }