Page MenuHomePhabricator

Publish additional context to the Aphlict server.
ClosedPublic

Authored by joshuaspence on Jun 5 2014, 6:43 PM.
Tags
None
Referenced Files
F14063050: D9396.diff
Mon, Nov 18, 4:21 PM
F14061547: D9396.diff
Mon, Nov 18, 7:12 AM
F14048266: D9396.diff
Thu, Nov 14, 7:17 AM
F14045418: D9396.id.diff
Wed, Nov 13, 3:56 AM
F14035937: D9396.diff
Sun, Nov 10, 8:05 AM
F14022230: D9396.diff
Wed, Nov 6, 3:46 PM
F14013811: D9396.diff
Sat, Nov 2, 3:37 PM
F14003783: D9396.id22413.diff
Sat, Oct 26, 10:42 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
Branch
aphlict-broadcast
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 880
Build 880: [Placeholder Plan] Wait for 30 Seconds

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
211

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
211

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).