queelag / fcm

MIT License
6 stars 2 forks source link

Failed to read current message #4

Closed getchardy closed 2 months ago

getchardy commented 3 months ago

I'm getting errors when attempting to receive messages:

Normal logging:

HeartbeatAck { last_stream_id_received: 2 }
 FcmClient -> onSocketDataBytes -> Failed to read current message, ready for the next one. 
 FcmClient -> onSocketDataBytes -> This tag is not handled.  [ 102, undefined ]
 FcmClient -> onSocketDataBytes -> This tag is not handled.  [ 44, undefined ]
 FcmClient -> onSocketDataBytes -> This tag is not handled.  [ 233, undefined ]

Debug logging enabled:

FcmClient -> onSocketLookup  [ null, '2607:f8b0:400e:c00::bc', 6, 'mtalk.google.com' ]
 FcmClient -> onSocketConnect -> The socket has been connected. 
 FcmClient -> onSocketReady -> The socket is ready. 
 FcmClient -> onSocketReady -> The login request has been created.  {
  account_id: Long { low: 0, high: 0, unsigned: false },
  adaptive_heartbeat: false,
  auth_service: 2,
  auth_token: '3759990711723626653',
  client_event: [],
  device_id: 'android-4f083e527c93963d',
  domain: 'mcs.android.com',
  heartbeat_stat: undefined,
  id: 'chrome-87.0.4280.66',
  last_rmq_id: Long { low: 0, high: 0, unsigned: false },
  network_type: 1,
  received_persistent_id: [],
  resource: '5694870252808279613',
  setting: [ { name: 'new_vc', value: '1' } ],
  status: Long { low: 0, high: 0, unsigned: false },
  user: '5694870252808279613',
  use_rmq2: true
}
 FcmClient -> onSocketReady -> The login request has been encoded  <Buffer 9d 01 0a 13 63 68 72 6f 6d 65 2d 38 37 2e 30 2e 34 32 38 30 2e 36 36 12 0f 6d 63 73 2e 61 6e 64 72 6f 69 64 2e 63 6f 6d 1a 13 35 36 39 34 38 37 30 32 ... 109 more bytes>
 FcmClient -> onSocketReady -> The login request buffer is ready.  <Buffer 29 02 9d 01 0a 13 63 68 72 6f 6d 65 2d 38 37 2e 30 2e 34 32 38 30 2e 36 36 12 0f 6d 63 73 2e 61 6e 64 72 6f 69 64 2e 63 6f 6d 1a 13 35 36 39 34 38 37 ... 111 more bytes>
 FcmClient -> onSocketReady -> The data has been reset.  {
  cursor: 0,
  received: { pids: [] },
  size: { packets: 1 },
  state: 0,
  tag: 3,
  value: <Buffer >,
  version: 0
}
 FcmClient -> onSocketReady -> The login request has been sent. 
 FcmClient -> onSocketReady -> The login request has been sent. 
 FcmClient -> onSocketKeylog  <Buffer 43 4c 49 45 4e 54 5f 48 41 4e 44 53 48 41 4b 45 5f 54 52 41 46 46 49 43 5f 53 45 43 52 45 54 20 39 36 35 63 64 61 31 62 35 35 64 61 38 38 35 64 66 30 ... 112 more bytes>
 FcmClient -> onSocketKeylog  <Buffer 53 45 52 56 45 52 5f 48 41 4e 44 53 48 41 4b 45 5f 54 52 41 46 46 49 43 5f 53 45 43 52 45 54 20 39 36 35 63 64 61 31 62 35 35 64 61 38 38 35 64 66 30 ... 112 more bytes>
 FcmClient -> onSocketKeylog  <Buffer 43 4c 49 45 4e 54 5f 54 52 41 46 46 49 43 5f 53 45 43 52 45 54 5f 30 20 39 36 35 63 64 61 31 62 35 35 64 61 38 38 35 64 66 30 63 38 66 38 39 62 32 33 ... 104 more bytes>
 FcmClient -> onSocketKeylog  <Buffer 53 45 52 56 45 52 5f 54 52 41 46 46 49 43 5f 53 45 43 52 45 54 5f 30 20 39 36 35 63 64 61 31 62 35 35 64 61 38 38 35 64 66 30 63 38 66 38 39 62 32 33 ... 104 more bytes>
 FcmClient -> onSocketKeylog  <Buffer 45 58 50 4f 52 54 45 52 5f 53 45 43 52 45 54 20 39 36 35 63 64 61 31 62 35 35 64 61 38 38 35 64 66 30 63 38 66 38 39 62 32 33 61 37 33 30 39 38 39 32 ... 96 more bytes>
 FcmClient -> onSocketSecureConnect -> The socket has been securely connected. 
 FcmClient -> onSocketSession  <Buffer 30 82 04 ef 02 01 01 02 02 03 04 04 02 13 01 04 20 97 1f a9 c8 1d 2f 2d 54 0c 5c 05 01 1d d8 d3 35 f2 f9 01 ee 3d f7 87 13 f3 7a 3a cb 6a 76 b9 38 04 ... 1217 more bytes>
 FcmClient -> onSocketSession  <Buffer 30 82 04 ef 02 01 01 02 02 03 04 04 02 13 01 04 20 73 bd 16 d7 ca 3f fd d5 d7 de 10 ec 13 b4 99 44 a8 bd b0 60 87 91 2c 29 c6 0e e8 d5 16 4f e9 4f 04 ... 1217 more bytes>
 FcmClient -> onSocketData  <Buffer 29> <Buffer 29> [ 1, 1 ]
 FcmClient -> onSocketData  <Buffer 03 3f 0a 13 63 68 72 6f 6d 65 2d 38 37 2e 30 2e 34 32 38 30 2e 36 36 12 1f 75 73 65 72 40 66 69 72 65 62 61 73 65 2e 63 6f 6d 2f 6e 6f 74 69 66 69 63 ... 15 more bytes> <Buffer 29 03 3f 0a 13 63 68 72 6f 6d 65 2d 38 37 2e 30 2e 34 32 38 30 2e 36 36 12 1f 75 73 65 72 40 66 69 72 65 62 61 73 65 2e 63 6f 6d 2f 6e 6f 74 69 66 69 ... 16 more bytes> [ 65, 66 ]
 FcmClient -> onSocketDataVersion -> 41 
 FcmClient -> onSocketDataVersion -> Increasing the cursor by 1.  [ 1 ]
 FcmClient -> onSocketDataVersion -> Setting state to TAG_AND_SIZE.  [ 1 ]
 FcmClient -> onSocketDataTag  [ 3, 'LOGIN_RESPONSE' ]
 FcmClient -> onSocketDataTag -> Increasing the cursor by 1.  [ 2 ]
 FcmClient -> onSocketDataTag -> Setting state to SIZE.  [ 2 ]
 FcmClient -> onSocketDataSize -> Increasing the cursor by 1.  [ 3 ]
 FcmClient -> onSocketDataSize -> Setting state to BYTES.  [ 3 ]
 FcmClient -> onSocketDataBytes -> LOGIN_RESPONSE -> The bytes have been decoded.  LoginResponse {
  setting: [],
  id: 'chrome-87.0.4280.66',
  jid: 'user@firebase.com/notifications',
  last_stream_id_received: 1,
  server_timestamp: Long { low: 1057158493, high: 398, unsigned: false }
}
 FcmClient -> onSocketDataBytes -> LOGIN_RESPONSE -> The login event has been emitted. 
 FcmClient -> onSocketDataBytes -> LOGIN_RESPONSE -> The login response has been set inside data. 
 FcmClient -> onSocketDataBytes -> LOGIN_RESPONSE -> The received pids have been reset. 
 FcmClient -> onSocketDataBytes -> LOGIN_RESPONSE -> The received pids have been stored. 
 FcmClient -> onHeartbeat -> The heartbeat ping has been created.  {
  stream_id: 0,
  last_stream_id_received: 1,
  status: Long { low: 0, high: 0, unsigned: false }
}
 FcmClient -> onHeartbeat -> The heartbeat ping has been encoded.  <Buffer 06 08 00 10 01 18 00>
 FcmClient -> onHeartbeat -> The heartbeat ping buffer is ready  <Buffer 00 06 08 00 10 01 18 00>
 FcmClient -> onHeartbeat -> HeartbeatPing -> The heartbeat ping has been sent. 
 FcmClient -> onSocketDataBytes -> Ready for the next message. 
 FcmClient -> onSocketData  <Buffer 07 0a 10 01 1a 00 3a 04 08 0c 12 00> <Buffer 07 0a 10 01 1a 00 3a 04 08 0c 12 00> [ 12, 12 ]
 FcmClient -> onSocketDataTag  [ 7, 'IQ_STANZA' ]
 FcmClient -> onSocketDataTag -> Increasing the cursor by 1.  [ 1 ]
 FcmClient -> onSocketDataTag -> Setting state to SIZE.  [ 2 ]
 FcmClient -> onSocketDataSize -> Increasing the cursor by 1.  [ 2 ]
 FcmClient -> onSocketDataSize -> Setting state to BYTES.  [ 3 ]
 FcmClient -> onSocketDataBytes -> IQ_STANZA -> The bytes have been decoded.  IqStanza {
  type: 1,
  id: '',
  extension: Extension { id: 12, data: <Buffer > }
}
 FcmClient -> onSocketDataBytes -> IQ_STANZA -> The iq event has been emitted. 
 FcmClient -> onSocketDataBytes -> Ready for the next message. 
 FcmClient -> onSocketData  <Buffer 01 02 10 02> <Buffer 01 02 10 02> [ 4, 4 ]
 FcmClient -> onSocketDataTag  [ 1, 'HEARTBEAT_ACK' ]
 FcmClient -> onSocketDataTag -> Increasing the cursor by 1.  [ 1 ]
 FcmClient -> onSocketDataTag -> Setting state to SIZE.  [ 2 ]
 FcmClient -> onSocketDataSize -> Increasing the cursor by 1.  [ 2 ]
 FcmClient -> onSocketDataSize -> Setting state to BYTES.  [ 3 ]
 FcmClient -> onSocketDataBytes -> HEARTBEAT_ACK -> The bytes have been decoded.  HeartbeatAck { last_stream_id_received: 2 }
HeartbeatAck { last_stream_id_received: 2 }
 FcmClient -> onSocketDataBytes -> HEARTBEAT_ACK -> The heartbeat event has been emitted. 
 FcmClient -> onSocketDataBytes -> HEARTBEAT_ACK -> The heartbeat ack has been set inside data. 
 FcmClient -> onSocketDataBytes -> Ready for the next message. 
 FcmClient -> onSocketData  <Buffer 08 e4 1c 12 08 34 33 43 37 37 42 33 39 1a 57 42 44 4f 55 39 39 2d 68 36 37 48 63 41 36 4a 65 46 58 48 62 53 4e 4d 75 37 65 32 79 4e 4e 75 33 52 7a 6f ... 1136 more bytes> <Buffer 08 e4 1c 12 08 34 33 43 37 37 42 33 39 1a 57 42 44 4f 55 39 39 2d 68 36 37 48 63 41 36 4a 65 46 58 48 62 53 4e 4d 75 37 65 32 79 4e 4e 75 33 52 7a 6f ... 1136 more bytes> [ 1186, 1186 ]
 FcmClient -> onSocketDataTag  [ 8, 'DATA_MESSAGE_STANZA' ]
 FcmClient -> onSocketDataTag -> Increasing the cursor by 1.  [ 1 ]
 FcmClient -> onSocketDataTag -> Setting state to SIZE.  [ 2 ]
 FcmClient -> onSocketDataSize -> Increasing the packets by 1.  [ 2 ]
 FcmClient -> onSocketDataSize -> Increasing the packets by 1.  [ 3 ]
 FcmClient -> onSocketDataSize -> Increasing the packets by 1.  [ 4 ]
 FcmClient -> onSocketDataSize -> Increasing the packets by 1.  [ 5 ]
 FcmClient -> onSocketDataBytes -> Failed to read current message, ready for the next one. 
 FcmClient -> onSocketDataSize -> Failed to decode the message with current size and bytes. 
 FcmClient -> onSocketDataSize -> Failed to decode the message with current size and bytes. 
 FcmClient -> onSocketDataSize -> Failed to decode the message with current size and bytes. 
 FcmClient -> onSocketDataSize -> Failed to decode the message with current size and bytes. 
 FcmClient -> onSocketData  <Buffer 69 6d 66 dd 40 f3 2b 22 d4 cb d1 90 c5 e3 6c 9a 56 f5 0d 5e 5c 9d 38 56 d1 e1 13 ec 34 ce cd 21 56 8f f3 b1 65 f4 3b c3 7a e0 39 75 d6 42 d4 b8 ef 0d ... 1136 more bytes> <Buffer 69 6d 66 dd 40 f3 2b 22 d4 cb d1 90 c5 e3 6c 9a 56 f5 0d 5e 5c 9d 38 56 d1 e1 13 ec 34 ce cd 21 56 8f f3 b1 65 f4 3b c3 7a e0 39 75 d6 42 d4 b8 ef 0d ... 1136 more bytes> [ 1186, 1186 ]
 FcmClient -> onSocketDataTag  [ 105, undefined ]
 FcmClient -> onSocketDataTag -> Increasing the cursor by 1.  [ 1 ]
 FcmClient -> onSocketDataTag -> Setting state to SIZE.  [ 2 ]
 FcmClient -> onSocketDataSize -> Increasing the cursor by 1.  [ 2 ]
 FcmClient -> onSocketDataSize -> Setting state to BYTES.  [ 3 ]
 FcmClient -> onSocketDataBytes -> This tag is not handled.  [ 105, undefined ]
 FcmClient -> onSocketDataBytes -> Ready for the next message. 
 FcmClient -> onSocketData  <Buffer 47 1f a4 c9 b7 f9 80 fc a7 8c a3 ea d3 da 5d f9 9d 40 ba 39 20 18 12 fa 8b a1 18 41 f1 54 39 13 9b 84 10 a8 5a 83 e8 c4 da 6b e2 99 cc 99 71 56 a7 89 ... 1136 more bytes> <Buffer 47 1f a4 c9 b7 f9 80 fc a7 8c a3 ea d3 da 5d f9 9d 40 ba 39 20 18 12 fa 8b a1 18 41 f1 54 39 13 9b 84 10 a8 5a 83 e8 c4 da 6b e2 99 cc 99 71 56 a7 89 ... 1136 more bytes> [ 1186, 1186 ]
 FcmClient -> onSocketDataTag  [ 71, undefined ]
 FcmClient -> onSocketDataTag -> Increasing the cursor by 1.  [ 1 ]
 FcmClient -> onSocketDataTag -> Setting state to SIZE.  [ 2 ]
 FcmClient -> onSocketDataSize -> Increasing the cursor by 1.  [ 2 ]
 FcmClient -> onSocketDataSize -> Setting state to BYTES.  [ 3 ]
 FcmClient -> onSocketDataBytes -> This tag is not handled.  [ 71, undefined ]
 FcmClient -> onSocketDataBytes -> Ready for the next message. 
 FcmClient -> onSocketData  <Buffer a2 07 77 7c 02 48 5e c6 bc 7a 14 b0 06 a0 43 2f 04 64 d8 6e 78 76 01 b5 cc d5 7c d9 1d b4 92 0f 03 fa 8c 66 35 f3 b4 82 89 c4 15 c5 e7 c5 03 7c 30 bd ... 79 more bytes> <Buffer a2 07 77 7c 02 48 5e c6 bc 7a 14 b0 06 a0 43 2f 04 64 d8 6e 78 76 01 b5 cc d5 7c d9 1d b4 92 0f 03 fa 8c 66 35 f3 b4 82 89 c4 15 c5 e7 c5 03 7c 30 bd ... 79 more bytes> [ 129, 129 ]
 FcmClient -> onSocketDataTag  [ 162, undefined ]
 FcmClient -> onSocketDataTag -> Increasing the cursor by 1.  [ 1 ]
 FcmClient -> onSocketDataTag -> Setting state to SIZE.  [ 2 ]
 FcmClient -> onSocketDataSize -> Increasing the cursor by 1.  [ 2 ]
 FcmClient -> onSocketDataSize -> Setting state to BYTES.  [ 3 ]
 FcmClient -> onSocketDataBytes -> This tag is not handled.  [ 162, undefined ]
 FcmClient -> onSocketDataBytes -> Ready for the next message. 

My code:

  const authSecret = generateFcmAuthSecret()
  const ecdh = createFcmECDH()

  const fcmRegistration = await registerToFCM({
    appID: environment.appID, // e.g. 'com.domain.myappname',
    ece: {
      authSecret: authSecret,
      publicKey: ecdh.getPublicKey(),
    },
    firebase: {
      apiKey: environment.firebase.apiKey,
      appID: environment.firebase.appID,
      projectID: environment.firebase.projectID,
    },
    vapidKey: '',
  })

  if (!('token' in fcmRegistration)) {
    console.error('Unexpected ARACNA ERROR', fcmRegistration)
    throw fcmRegistration
  }
  console.log('ARACNA REGISTRATION SUCCESS!', fcmRegistration)

  // Notify backend of new fcm token for this device
  await opts.client.registration.updateDevice(opts.deviceId, {
    environment: environment.type,
    registrationToken: [fcmRegistration.token],
  })
  console.log('Device registration token updated:', fcmRegistration.token)

  const fcmClient = new FcmClient({
    acg: {
      id: fcmRegistration.acg.id,
      securityToken: fcmRegistration.acg.securityToken,
    },
    ece: {
      authSecret: authSecret,
      privateKey: ecdh.getPrivateKey(),
    },
  })

  fcmClient.on('message', (message) => {
    console.log('FCM MESSAGE!!!', message)
  })

  fcmClient.on('message-data', (data) => {
    console.log('FCM MESSAGE DATA!!!', data)
  })

  fcmClient.on('heartbeat', console.log)

  fcmClient.on('iq', console.log)

  fcmClient.on('login', console.log)

  fcmClient.on('close', console.log)

  const connectResult = await fcmClient.connect()
  if (!connectResult) {
    throw connectResult
  }
choiman1559 commented 3 months ago

Sorry, But You need to upload your implementation first when you open issue.

If you not upload your implementation, Nobody (except you) can check where is wrong.

getchardy commented 3 months ago

Sorry, But You need to upload your implementation first when you open issue.

If you not upload your implementation, Nobody (except you) can check where is wrong.

Great point, I have updated the issue info with my code.

choiman1559 commented 3 months ago

Try type-casting the data in the acg.id and acg.securityToken items to fcmClient as BigInt.

alchemicas commented 3 months ago

Hi @getchardy , looks like my library is failing to decode the "data_message_stanza" message in this specific case, I'd like to replicate it locally, could you please provide me the API call that you're making to firebase to send the notification/message?

It would be super helpful, thanks a lot and sorry for the late reply! 🙏

Also thanks to @choiman1559 for providing support!

alchemicas commented 3 months ago

I've also released a new version, 1.0.22, which logs decode and decrypt errors, it might be useful in trying to debug this error on your side.

Update: I've tried your code using my variables and sending a test message, it works as expected, so the only differences here can be:

Like I said before, it would be helpful to know the body of the message you're sending, and also trying the 1.0.23 version of @aracna/fcm to see what errors are happening during the decoding/decrypting phase.

Thanks!

getchardy commented 2 months ago

Hi thanks for looking into this, and sorry for the delay responding. I believe the issue is happening because our message is large, and it is getting split into multiple data packets coming over the websocket.

I did some tracing and saw that the combined message data for an example message was 3650 bytes, and it was being split into 4 parts of respective lengths 1186,1186,1186,92. (onSocketData is called for each of those parts.)

A sample message payload is:

{"android":{"priority":"high","ttl":"86400s"},"data":{"anonyome":"{\"version\":\"1.18.0.18642\",\"type\":\"ADM_MSGINFO\",\"timestamp\":1712122923601,\"encrypted\":{\"publicKeyId\":\"2F234530-79D6-4A37-B8F4-900BB710770B\",\"wrappedKey\":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pkH3ghf0uMjCNz-IopJA11d"}

We send using: https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages/send

I would be interested to see if you are able to reproduce by sending the same payload. I am pretty sure the issue is processing of large (multi-part) messages.

Thanks!

alchemicas commented 2 months ago

Hi @getchardy , thanks a lot for providing me with the payload, I managed to replicate it and solve it, as I expected there was an edge case I was not handling which was basically multiple bytes being received sequentially but at different times.

Please try with version 1.0.24 and let me know, in case it still doesn't work please reopen the issue! Thank you for helping me improve the library!