Why are some messages not sent by the Facebook API?

For several months we launched the Facebook Chat Chat API, but since then we have started to receive 1 out of 5 messages that are no longer sent.

For sending, we use this:

sender_chat_id = "-#{uid}@chat.facebook.com"
    client = Jabber::Client.new(Jabber::JID.new(sender_chat_id))
    client.connect
    client.auth_sasl(Jabber::SASL::XFacebookPlatform.new(client,
                                                         app_id,
                                                         access_token,
                                                         app_secret]
                     ), nil)

    # Send messages

    client.send(jabber_message)

    # Close chat client
    client.close

and it seems to work. then we check if the message was sent using:

Fql.execute({
                 "query1" => "SELECT body FROM message WHERE thread_id IN (SELECT thread_id, recipients FROM thread WHERE folder_id = 1 AND #{receiver_uid} IN recipients ORDER BY updated_time DESC) ORDER BY created_time DESC"
             }, {
                 access_token: access_token
             })

And, unfortunately, sometimes the message does not appear in the Outbox.

EDIT:

The problem seems to come from messages sent to people who don’t have a stream with a sender containing previous messages. In these cases, the message sent by the Facebook chat API is not delivered. However, if the sender sends the message to the recipient (or vice versa) "manually", the stream opens and all messages sent earlier by the API appear ...

+3

All Articles