Removal of "perspectival attributes" in DM streaming


#1

To better conform to expected behavior, we’re modifying the streamed format of direct message in User and Site Streams by phasing out streaming certain attributes. On September 27, 2013, we will first change all returned values for these attributes to “false”, and then fully deprecate them in late Fall 2013.

Direct messages in the stream contain two user representations: “sender” and “recipient”. (See the [node:9742] documentation for an example from the REST API, which is materially similar.)

Currently, each user object includes “perspectival attributes”, such as the boolean “following”, which indicates whether the user object is being followed. (See also [node:7287] and [node:6981].) However, for both user objects and for the DM message streamed on behalf of the sender and recipient, all such perspectival attributes are relative to the sender.

For example, for a DM from X to Y, the message streamed to a User or Site Stream that’s streaming X’s DMs will have in both “sender” and “recipient” objects a value for “following” that indicates whether X is following X and whether X is following Y, respectively. Similarly, for the same DM from X to Y, the message streamed to a User or Site Stream that’s streaming Y’s DMs will have in both “sender” and “recipient” objects a value for “following” that indicates whether X is following X and whether X is following Y, respectively. In other words, the perspectival attributes streamed when Y receives a DM are still from the perspective of X.

Here are two JSON snippets that illustrates the above:

The stream on X’s behalf for the DM from X to Y:


“recipient”: {

“following”: true // meaning X is following the recipient, Y

},

“sender”: {

“following”: false // meaning X is not following the sender, X himself

},

 

The stream on Y’s behalf for the DM from X to Y:
<code language="javascript" linenumbers="off">
...
  “recipient”: {
    ...
    “following”: true   // meaning X is following the recipient, Y
    ...
  },
  ...
  “sender”: {
    ...
    “following”: false    // meaning X is not following the sender, X himself
    ...
  },
...

Note that both DM representations are the same, with the “following” attribute in this example always indicating whether X follows the sender or recipient, regardless of who’s reading the DM, X or Y.

To avoid the confusion this creates and to reduce redundancy, we are eventually removing perspectival attributes from DM streaming altogether. To maintain backward-compatibility for applications relying on DM streaming, the first step of our phase-out is having all such attributes return “false” as of September 27, 2013.

The complete list of these perspectival attributes that will no longer be streamed is as follows:

  • following
  • follow_request_sent
  • notifications

If you have any questions, please don’t hesitate to reach out to us on this thread!