node-gcm-ccs icon indicating copy to clipboard operation
node-gcm-ccs copied to clipboard

CONNECTION_DRAINING

Open Saivenkatesh opened this issue 9 years ago • 2 comments

The connection draining control message does not have data.message_id set, currently the code is not handling the message because of this. The check should be removed for control messages.

Saivenkatesh avatar May 26 '16 12:05 Saivenkatesh

Do you know what the expected behavior is? Is the check for data.message_id not needed?

jacobp100 avatar May 26 '16 15:05 jacobp100

According to the spec https://developers.google.com/cloud-messaging/ccs#response the expected format for the connection draining message(this is the only control message) is

   <message>
    <data:gcm xmlns:data="google:mobile:data">
    {
     "message_type":"control"
     "control_type":"CONNECTION_DRAINING"
    }
    </data:gcm>
   </message>

The other type of messages from the google servers will contain a message_id, but don't think we need to have the check assuming GCM sticks to the spec.

Saivenkatesh avatar May 26 '16 17:05 Saivenkatesh