Open EGreg opened 10 years ago
And also in that issue describe mechanism for handling notification rules.
For example, Streams/invited should have a rule handler that runs before the others and checks Streams.Invite table for invite with same token, and passes it ro the rule handler so it can inspect the "requested" state before making its decision.
Make another issue for handling Streams/authenticated/$App streams which would then update contacts list on that baseUrl, in case you want to join it. Use a regular Users/contacts tool to display these contacts filtered to who is on that particular baseUrl.
And also in that issue describe mechanism for handling notification rules.
For example, Streams/invited should have a rule handler that runs before the others and checks Streams.Invite table for invite with same token, and passes it ro the rule handler so it can inspect the "requested" state before making its decision.
Make another issue for handling Streams/authenticated/$App streams which would then update contacts list on that baseUrl, in case you want to join it. Use a regular Users/contacts tool to display these contacts filtered to who is on that particular baseUrl.
Currently, the notifications are delivered to email addresses and mobile phone numbers, but not all the functionality is implemented.
Please refactor the code in
plugins/Streams/classes/Streams.js
andplugins/Streams/classes/Streams/Stream.js
to be cleaner and match the PHP code in functionality, such asstream.subscribe()
andstream.join()
.The Node.js processes should be designed to work after a crash and subsequent restart, maintaining caches such as
Participant.get.cache
. Because of this design requirement, many objects (such asStream.Subscription
andStream.Rule
rows) aren't cached but repeatedly fetched from the database when needed. To cache them, we would need to make sure that a) only PHP updates those rows, and b) PHP will callQ_Utils::sendToNode
to hit some newly implementedStreams.onEvent('post')
event handler inStreams.js
.Add a new method for
deliver
besides themobile
andemail
ones, calledurl
. The value would be a URL to POST structured notification data to. The handler for this URL might be in PHP or it might be in Node.js . Better to have it in Node.js because, if everything is running on the same machine and Node.js is issuing these requests, then we don't want 500 concurrent requests being handled by PHP. Moreover, if the URL is discovered to be internally handled by the same Node.js script that "delivers" the notification, the whole HTTP transport can be avoided and the handler can be called internally.Finally, make a new issue for respecting the fields in
streams_subscription
and then instreams_rule
. Fields such as subscription: untilTime, filter, duration; and rule: filter, deliver, relevance