CDK App Sync GraphqlApi Subscription Filtering Extension - aws-cdk

I have an App Sync GraphQLAPI with a bunch of lambda data sources. One of these lambdas handles a mutation that stores chat messages for a chat room. I need to create a subscription on that mutation for other users in the chat room so that they will get messages that are posted.
It is my understanding that I can create a subscription filter to accomplish this: in my case the filter would be the chatroom ID.
How do I create a subscription filter as shown in the documentation above using the CDK?

Related

Graph Subscription Email Resource For All Emails

I am working on a system that allows the user to log their email conversation to our CRM.
This uses MS Graph subscriptions that create a subscription to a given email conversation. We then process the Graph notifications. When creating the subscriptions we set the resource like this:
/users/{id}/mailFolders('inbox')/messages
/users/{id}/mailFolders('sentItems')/messages
This gives us notifications for when the user sends or receives an email on that conversation thread.
This works great, but we discovered that if the user has a rule set up to send items with a certain subject to a different folder, when receiving a new email that they have subscribed to, we don't receive a notification.
I am guessing that this is due to us subscribing to the inbox and sentitems but not the custom folder that they have their rule directed to.
I noticed that there is also a way to set the resource as:
/users/{id}/messages
Can someone tell me whether this will set up the subscription to receive emails from all folders?
If this is the case, we wouldn't want to receive notification for example when the user deletes and email.
Additionally, we currently create 2 separate subscriptions. Is there a way to create a subscription for more than 1 resource (e.g.inbox and sentitems) under the same subscription?
thanks
The resource path users/{id}/messages is just a shortcut to the one with the inbox mark folder. A subscription to it will only notify you of emails going to that folder.
A subscription only allows you to subscribe to one resource at a time. You could use JSON batching to create/maintain multiple subscriptions in the same call, but that would only be beneficial to reduce the number of http requests.
You'll need to subscribe to each folder you want to get notified for, a request to users/{id}/mailFolders should give you a list of the folders for the inbox.

Adding persistent updates to channels in Twilio Programmable Chat

We have recently implemented group chat functionality for an existing application using Twilio Programmable Chat.
Context: The application allows users to connect with each other and join groups. We are using Twilio to add a real-time chat room within each group so that group members can communicate. So when a user joins a group, he/she accesses the Twilio chat channel, as well as various other group resources.
When a user joins a group (as defined by our app), it seems that they are not considered a member of the group's channel unless they are active in the chatroom (i.e., when app is not in foreground, user is not listed as channel member). We are trying to do find some way to introduce persistent notifications for the group in the Twilio channel (i.e., "John Smith has joined the group" or "Jane Smith has left the group"). In another SO discussion, philnash had mentioned using the Twilio REST API to send system-authored messages with this information, and then manage these messages on the UI side to format them as group "updates". That makes sense!
My questions are:
Do I need to handle sending system-authored messages on our backend? If so, I'll need to add a field to my Groups model to include the Twilio channel SID for the group.
Is it possible to mute notifications for these system-authored messages (which will be formatted as "channel updates")? I.e., is it possible to not send push notifications to users whenever the message being sent is authored by system?
I hope my questions are clear enough. Thanks so much for any answers or guidance anyone can provide for the above!!

How to create a non-random subscription with PusubIO?

I am using google dataflow and pubsubIO to receive a stream of various information from another app. Currently the pipeline creates a random subscription to the topic and then receives the information from here. I was wondering if there was a way to create a non-random subscription within my pubsubIO?
I know you can create a subscription in the cloud console and then sub from there using fromSubscription(), but I wanted to know if my app could create the subscription that subscribes the the topic without having to create it beforehand.
Cheers.

get list of subscribed users for AWS appSync

Is there currently anyway to get a list of subscribed users?
I want to create a chat room and let people know when users are entering or leaving the room which they do by subscription to the mutations containing that room ID.

ejabberd - mucsub with ejabberdctl

I try to get familiar with the new ejabberd feature (i.e. Multi-User Chat Subscriptions) and just wondering if there is any command that can get those useful info of the subscrition sub as per following
List of subscriptions
- list of muc room subscribed for a particular user
List of subscriber
- list of subscriber for a particular muc room
Note : List of subscriptions is technically can be retrieved via stanza. But I'm not able to find any document to use stanza for List of subscriber.
How to retrieve the list of subscriptions for a user is described in the documentation: https://docs.ejabberd.im/developer/proposed-extensions/muc-sub/#list-of-subscriptions
Getting the list of subscribers on a MUC room features is not yet implemented.

Resources