Giter Site home page Giter Site logo

Infinite loop about fb-messenger-php-example HOT 6 CLOSED

pimax avatar pimax commented on September 26, 2024
Infinite loop

from fb-messenger-php-example.

Comments (6)

vhcsilva avatar vhcsilva commented on September 26, 2024

Hi, dzarezenko.
This is happening because the script executes while the messaging windows is open. So, even if user dont send something the script will check it.

from fb-messenger-php-example.

KingBBQ avatar KingBBQ commented on September 26, 2024

I fixed it and did a pull request with the changes, that filters echos out and doesn't respond to them.

from fb-messenger-php-example.

graphtobinary avatar graphtobinary commented on September 26, 2024

Hi all please help me out with this Infinite loop i am new with this bot is continuously send the messages
Thanks In advance

from fb-messenger-php-example.

KingBBQ avatar KingBBQ commented on September 26, 2024

As said, check out my changes here: #20
Imho it should fix it...

from fb-messenger-php-example.

hycday avatar hycday commented on September 26, 2024

I am not sure this is a 'bug', but the contrary, something to be seriously solved.

It seems that it is linked with the following :
https://developers.facebook.com/docs/messenger-platform/faq

(quoting for reference) :

Why do I keep on getting developer alerts that my webhook has not been accepting updates, or keep getting the same webhook calls repeatedly?
Make sure your webhook is responding with a status code of 200. This communicates to us that the webhook was successfully received. If you do not return a 200, we will retry the call until successfully completed. Also, if a webhook doesn't return a 200 for an extended period of time, we will surface developer alerts.

Also, note that a successful status code is returned in a timely manner. A webhook call with timeout after 20 seconds. Be sure to architecture your code such that webhooks are processed asynchronously so that a successful status code can be returned immediately and processed separately.

and here, they describe the solution, but not sure how to implement it:
https://developers.facebook.com/docs/messenger-platform/webhook-reference#response

Your webhook callback should always return a 200 OK HTTP response when invoked by Facebook. Failing to do so may cause your webhook to be unsubscribed by the Messenger Platform.

It is extremely important to return a 200 OK HTTP as fast as possible. Facebook will wait for a 200 before sending you the next message. In high volume bots, a delay in returning a 200 can cause significant delays in Facebook delivering messages to your webhook.
A delivery receipt will automatically be sent to the user after your webhook has acknowledged the message. You can also use Sender Actions to notify that the message has been seen.

I am not sure that filtering out echos and ignoring them was the right solution.

What do you think ?

from fb-messenger-php-example.

wittfabian avatar wittfabian commented on September 26, 2024

#20 Merged

from fb-messenger-php-example.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.