Closed getchardy closed 2 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.
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.
Try type-casting the data in the acg.id
and acg.securityToken
items to fcmClient
as BigInt.
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!
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!
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\":\"KK0YA4zeXwWPs2HL0tcWFQzEWq6v+ryFpB2OfA1pPquZdYfxr/5CB/BxenIpHeV6Zl3rqlEADyVEe5rd0zwSAV16tEv9FusD8grTu1ZlUONSDQmufgonl6yttJ7dGOGF+XsZico5l8nvdZRpyyZjWaPZwdY6ppjv0aW/Afhlyg51E2lQbkXeMTdKI2/TuxAAGD/lI60dUe02OM54ABFJH7zb/4ORM3lhn5afTypJFMZKodtVwQ7m+yE0Aa4m3DeiaRaF5Fi+8IUNScG+nylFrWqPyBFTJjkJN0jtjYFQFiDU4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TamMVdXIAa+bNXMen8metH/D2ZuZRcPsVIMrdfAkWZmKE6/7AKl7IgI1kAReDhz13ayisQN1hRBn8c+AF+9TQkR/ZHZxLsMVSd446vkWAqBjXlGbRitO/IvDt6issMUqd3tf5KaIPejlrApXfIE25UIhM2g8Z4WLJgOGLOO7q2hTdT2G0Q7mfvRmi5DhcKG1vX4Q1bLKXTAd2lHXtyma1TfDCD9yRGnTzvYZsAqChkP3/IOyvlYb4kEqivSavaH14JcWtd1S6ONb8sTJ2t2vlkLlw47qpTVIyM0qZUBN3x0isaFIEshDlMtIxmrpvFFDtL3eOHf1hQ6AvAeeEcFO0lNuGT0tWaCfunREjNGXNvCbdY6w2bqvBnDA3hUhah5Yf+iW8Yy0iu9L/VRAHp+uc8ZKu507ojVG++pwEBuEdJUrsXbU9VLkrIOpwYOO4f+tP15xQJGGOv9fuIAg9m8pUs91qni52oPq8vIFsu0UFtsqkJ7qxAd0sIyBi2ES63VJvIIDkuGUDN579ZUsksc7iLwGJ0d9epD81M1EIQJfCihp7tnb1+261+OWxyagG/TWlFCP8PPEWhxtOgfh3S9w3XmIHmH9kGS957rG+VV6PFAIZLsAag=\"}}"},"token":"dm5uwQ6xTIiSJC7Hs7zqQM:APA91bGl-Zu5W0HViuVbqFyINJFYXOAyjfHuhXWuhNpRiJbjVV8uuurKqIUN26CcDihUiBbDNcy2yuX4f-LdggC524jCCPVCeyUjHMMupSXgL6ePqMkPZpkH3ghf0uMjCNz-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!
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!
I'm getting errors when attempting to receive messages:
Normal logging:
Debug logging enabled:
My code: