gcm icon indicating copy to clipboard operation
gcm copied to clipboard

XMPP lib cannot handle stanza error responses

Open soygul opened this issue 10 years ago • 0 comments

When we get following in response to a message with broken stanza (as described here: https://developer.android.com/google/gcm/ccs.html#stanza):

<message id="3" type="error" to="[email protected]/ABC">
  <gcm xmlns="google:mobile:data">
     {"random": "text"}
  </gcm>
  <error code="400" type="modify">
    <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
    <text xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
      InvalidJson: JSON_PARSING_ERROR : Missing Required Field: message_id\n
    </text>
  </error>
</message>

The resulting output is: &{XMLName:{Space:jabber:client Local:message} From: ID: To:[email protected]/... Type:error Subject: Body: Thread: Other:[ ]}

We should instead get our broken request:

  <gcm xmlns="google:mobile:data">
     {"random": "text"}
  </gcm>

and the error details back in Other:[] array.

soygul avatar Dec 30 '14 00:12 soygul