Page MenuHomePhabricator

Publish additional context to the Aphlict server.
ClosedPublic

Authored by joshuaspence on Jun 5 2014, 6:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 6:33 PM
Unknown Object (File)
Sat, Apr 27, 4:00 AM
Unknown Object (File)
Wed, Apr 24, 10:17 PM
Unknown Object (File)
Wed, Apr 24, 7:02 AM
Unknown Object (File)
Wed, Apr 24, 7:02 AM
Unknown Object (File)
Wed, Apr 24, 7:02 AM
Unknown Object (File)
Wed, Apr 24, 7:01 AM
Unknown Object (File)
Fri, Apr 19, 3:38 AM
Subscribers

Details

Summary

Ref T4324. As well as sending the key for the notification, also publish the notification type and a list of subscribers to the Aphlict server.

The idea here is that the Aphlict server passes anything within the data key to the clients, whereas other keys (such as subscribers) will be used by the server to determine where the notifications should be routed.

Note that these changes don't do anything useful, but are a prerequisite for further work on T4324.

Test Plan

Sent myself test notifications at /notification/status/. Also inspected the Aphlict server debug output:

> sudo ./bin/aphlict --foreground
Starting server in foreground, ignoring pidfile...
Launching server:

    $ node '/usr/src/phabricator/support/aphlict/server/aphlict_server.js' --port='22280' --admin='22281' --host='localhost' --user='aphlict' --log='/var/log/aphlict.log'

[Thu Jun 05 2014 18:38:14 GMT+0000 (UTC)] Started Server (PID 15437)
[Thu Jun 05 2014 18:38:16 GMT+0000 (UTC)] <FlashPolicy> Policy Request From ::ffff:10.0.0.1
[Thu Jun 05 2014 18:38:16 GMT+0000 (UTC)] <Listener/1> Connected from ::ffff:10.0.0.1
[Thu Jun 05 2014 18:38:19 GMT+0000 (UTC)] notification: {"data":{"key":"6021516228036848559","type":"notification"},"subscribers":["PHID-USER-cb5af6p4oepy5tlgqypi"]}
[Thu Jun 05 2014 18:38:19 GMT+0000 (UTC)] <Listener/1> Wrote Message

Diff Detail

Repository
rP Phabricator
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Publish additional context to the Aphlict server..
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

See inline: I think the types probably should be one level of abstraction up? e.g., notification, conpherence, etc?

src/applications/feed/PhabricatorFeedStoryPublisher.php
181

I think this type should just be "notification" or similar. storyType has a bunch of class names?

This revision now requires changes to proceed.Jun 5 2014, 6:47 PM
src/applications/feed/PhabricatorFeedStoryPublisher.php
181

I agree. Is there an easy way to get this though, from within the PhabricatorFeedStoryPublisher class? Or we could pass it in as a parameter perhaps.

I would probably just hard code it for now, and then move the "talk to Aphlict" logic to a new class as soon as a second thing start talking to Aphlict.

joshuaspence edited edge metadata.
joshuaspence edited edge metadata.
joshuaspence edited the test plan for this revision. (Show Details)
  • Use notification type instead of story class.

Oh, I mean: this should always be just the string literal "notification".

The client will never do anything differently with any of these, will it? That is, when notified about a feed story, the behavior is always to make a request to /notification/individual/ and then pop a bubble.

In the future, it might receive a new type of event like "message", which would cause it to make a request to /conpherence/messages/ and update the visible Conpherence or whatever.

Or are there things you think we might want to do based on audit vs commit vs token vs etc?

Oh, I mean: this should always be just the string literal "notification".

The client will never do anything differently with any of these, will it? That is, when notified about a feed story, the behavior is always to make a request to /notification/individual/ and then pop a bubble.

In the future, it might receive a new type of event like "message", which would cause it to make a request to /conpherence/messages/ and update the visible Conpherence or whatever.

Or are there things you think we might want to do based on audit vs commit vs token vs etc?

Oh ok, I completely misunderstood. That sounds reasonable to me... I didn't have any secret plans.

joshuaspence edited edge metadata.
  • Type should be just be "notification" for now.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Jun 5 2014, 7:09 PM
epriestley updated this revision to Diff 22415.

Closed by commit rPfe98aa6839f0 (authored by @joshuaspence, committed by @epriestley).