What can be the reason of “Unable to find subscription with identifier” in Rails ActionCable? - ruby-on-rails

We have the iOS Application in which we are using the action cable to give me fast response as user like something or comment on any post. Few days back everything is working fine. But from last few days action cable is not working. And my iOS application is live on the App Store. When ever my back end developer broadcast from her side. I will not get the response. When I hit the action cable multiple times. Then I get the single response out of 4 of them.
Now if any body help me what can I do right now.
What can be the reason of “Unable to find subscription with identifier” in Rails ActionCable?
[![> Unable to find subscription with identifier:
{"channel":"CommonChannel","auth_token":"zoRGfSZhS3mH6UxENVcJ"}]]1]1
We have a single channel in which we have multiple actions because I cannot subscribe the channel every time and then hit any function it makes me irritate to do every time subscribe the channel and then call the function.
Does any body has the solution for this issue. We have tried the wait loop as well after subscribing any channel.
Please anybody help me.
Thanks in advance.

Might be a race condition, see other question: What can be the reason of "Unable to find subscription with identifier" in Rails ActionCable?
In rails the issue (https://github.com/rails/rails/issues/25381) was supposed to be fixed, but maybe you found another way to trigger it.
Try to add some wait between the initial hello request and the subscription. If you are using graphql subscriptions, try to add a sleep between the actioncable subscription and the graphql subscription

Related

Facebook/Instagram webhook for DM not working anymore

We are using webhooks for "instagram" resource and then executing some logics based on type of webhook we receive. One of the webhook in the list is the "message" webhook which we were receiving till 16th may 2022 around 1:30 PM IST and then it suddenly stopped triggering from facebook.
Surprisingly we are still able to receive webhooks for other event types for same "instagram" resource from facebook (like 'message_reaction', 'comments' etc)
I don't know what is wrong here, as I haven't made any changes to the developer account which I am using for testing these webhooks. Can anyone help here, as we are stuck at a very important step in our product lifecycle?
Also I have started a thread on Facebook community also, Link to the same can be found here
Screenshot to webhook setting page
I faced a similar issue couple of days ago, what I suggest you to do is first you can test your webhook using the the tests FB provides and make sure everything works fine on your side. If so, the threads and questions on FB community are rarely getting answered so I suggest you to report a bug on your app from here and the guys from FB are really helpful and will communicate with you within 2 working days max and follow up with you till you solve that issue.

Pubsubhubbub doesn't send push notification any more

In order to get notified whenever a channel has a new video I have implemented the Pubsubhubbub protocol as suggested here: https://developers.google.com/youtube/v3/guides/push_notifications
The server I have for the callbackUrl is a Node.js application and I use the "pubsubhubbub" package to bootstrap the creation and handling of any events.
But for whatever reason, the server doesn't receive any more requests. I've tried resubscribing to the YouTube channels but to no luck. Is there an expiration date after which all subscriptions are dropped so that I need to re-subscribe regularly?
Any help would be very much appreciated.
Short answer, YES. Unfortunately, You need to resubscribe again and again.
As I was looking for the same answer actually, after searching a bit, I found out finally that the subscription has an expiry date. See the "Subscriber Diagnostics" section for details (screenshot from "Subscriber Diagnostics" of my subscription)

Twilio Task Router , Reservation Changing Status

Following the tutorials to creation of a task router (Workspace,queue,worker,task) and task creation via a Phone Call.
I am able to successfully land the call and create the task via my node.js app.
After adding the Agent UI via tutorial #
Agent UI Add Project
Here is the application flow:
Customer calls Twilio number
Twilio Voice Posts to a Node.js Rest API
Twilio Voice Posts to a Node.js Rest API
Twiml generated and user gets Prompts
User chooses an option
Response is Posted to a Node.js API and task is created
The above steps are success
On the client
Agent launches the node.js app with taskrouter.min.js and agent.js as provided in the sample above.
Customer gets the default hold noise, on the agent browser a series of events "reservation created, update and reservation cancels" are observed. Posting the console logs towards the end.
Observation 1, customer gets the default Hold noise confirms that Task is created successfully via the App. Task also seen on the Twilio Admin GUI
Observation 2, Getting a sequence of Reservation,Update,Cancel events multiple times.Also Observed that the dateCreated, dateUpdated and dateStatusChangedare year1970 , 1970-01-17T17:52:39.413Z.
Any pointers would be greatly appreciated.
[Edit:]
I do see similar issues with the PHP Sample code as well. Found that the Date is not an issue.
[Edit:]
Reached out to Twilio Support, hoping to hear from them, no luck so far
[RESOLVED]
Heard back from twilio support, thanks twilio. Issue was with the Assignment Callback URL on the Workflow. My API was /Get. Changed it from Get to Post, to make it work. As the assignment URL was not reachable (via POST), task router was trying to cancel the reservation.
Twilio employee here.
This is result of TaskRouter being able to hit your AssignmentCallbackUrl with an HTTP POST request. We've noticed that on your Account there's this notification message:
Cannot POST /assignment
Please enable POST for your AssignmentCallback endpoint.
TaskRouter will actively cancel the reservation if it cannot hit your AssignmentCallbackUrl or there is an error when issuing an Assignment Instruction.
The several updates in the console are due to the fact that TaskRouter cancels the reservation due to not hitting the AssignmentCallbackUrl, moving the Worker back to the previous state (Available), and then trying to assign the Task again, and thus generating another Reservation for the Worker for the same Task (repeat 15x until the Max Task Assignment is hit).
Heard back from twilio support, thanks twilio. Issue was with the Assignment Callback URL on the Workflow. My API was /Get. Changed it from Get to Post, to make it work. As the assignment URL was not reachable (via POST), task router was trying to cancel the reservation.

Best way to show the recent post - Objective C

I have an iOS app which is installed in two different device but logged in with same account. If I do a new post from a device it should be shown instantly in the other devices. Currently I am refreshing the posts feed for every 10 seconds interval. Is this is a optimal way or is there any other better solution for this.
As #wattson12 was saying push notification are designed for that.
I would recommend using an API for that : Urban Air Ship
What you do is called polling. It’s the simplest solution, but it’s not optimal, because it requires you to query the server constantly and still there’s delay before you know about the new posts.
One way to know about new posts is to keep an HTTP connection open, waiting for the server to notify you about new posts (see Wikipedia for details, also related question here). Other option is push notifications: the server can post a notification when new content arrives. I’m not sure which one is technically more simple.

In Newsstand app how do I find a list of devices that are subscribed?

I can't afford UrbanAirship so I'm trying to program the server side of a Newsstand app myself.
I plan on using the JavaPNS API.
The one thing I can't seem to figure out is how to find a list of users who have a subscription in my app.
Can I query this information from Apple some how?
If I can't then I guess that means that each time a user subscribes they send their device token directly to my server. I hope this is not the case because I was hopping to run the server on my laptop and send out pushes myself without having to keep the laptop running all day listening for new subscribers.
Thanks!
Looks like I do need to register each device with my server: http://www.ibm.com/developerworks/web/library/mo-ios-push/index.html#resources
You kind of found your answer but just in case you really need a server for not only handling the push notification (for telling your app in Newsstand to check the new issue and download it in the background) but also for subscription and in-app purchasing.
Every time you launch the app you should check few things before you refresh the UI. You should check if the user is a subscriber or has user already bought the issue so you can show view/download button instead of Buy button.
Check out these tutorials if they help to understand these communications better but believe me you will end up with one of those services like Urban Airship (Which I think UA is the best option because it handles all in one not just push notification):
http://ios-blog.co.uk/tutorials/how-to-make-a-magazine-app-in-ios-part-i/
this one is more focus on server part:
http://ios-blog.co.uk/tutorials/how-to-make-a-magazine-app-in-ios-part-ii/
http://www.viggiosoft.com/blog/blog/2011/10/17/ios-newsstand-tutorial
http://www.raywenderlich.com/2797/introduction-to-in-app-purchases
And as always this is the best place for start (it has everything you need):
https://developer.apple.com/devcenter/ios/newsstand/
These are some resources to help you in developing app for Newsstand but still there are not enough people out there to share their experience.
Best of luck.
Edit: Add these two links two this list:
http://www.marco.org/2012/10/11/the-magazine
http://www.marco.org/2012/12/12/the-magazine-future-of-publishing

Resources