Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Facebook.js doesn't understand beta standyby message. #962

Closed
Stubbs opened this issue Aug 19, 2017 · 2 comments
Closed

Facebook.js doesn't understand beta standyby message. #962

Stubbs opened this issue Aug 19, 2017 · 2 comments

Comments

@Stubbs
Copy link

Stubbs commented Aug 19, 2017

On initialising a new conversation with botkit I get the following error:

TypeError: Cannot read property 'length' of undefined
    at Object.Facebookbot.facebook_botkit.handleWebhookPayload (/app/node_modules/botkit/lib/Facebook.js:266:59)
at /app/components/routes/incoming_webhooks.js:18:20
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    at next (/app/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/app/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
    at /app/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/app/node_modules/express/lib/router/index.js:335:12)
    at next (/app/node_modules/express/lib/router/index.js:275:10)
    at serveStatic (/app/node_modules/serve-static/index.js:75:16)

It's caused by a message arriving at the webhook that doesn't have a message element as part of the payload:

{
   'id': '267342063756729',
   'time': 1503131104641,
   'standby': [ [Object] ] 
}

The payload is actually from a beta feature and the workaround for now is to unsubscribe from them on your pages messenger settings:

screenshot

@ouadie-lahdioui
Copy link
Collaborator

Thanks @Stubbs for the report, PR #978 just being created

@peterswimm
Copy link
Contributor

Issue fixed with merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants