Closed jrconlin closed 3 years ago
I have the necessary testing setup ready, I'll try to reproduce the issue with this PR.
I think the error is due to incorrectly accounting for FCM's (total) message size limit, a la https://github.com/mozilla-services/autopush-rs/issues/203. It looks like all of the message_size
values in Sentry are around 4094 bytes, 2 bytes under the 4096 limit.
I was able to trigger the error by passing through a message which just passed under our size validation but when wrapped in the FCM payload was over 4096 bytes.
Edit: also the error object did not have any details: Server error: INVALID_ARGUMENT: Request contains an invalid argument. No Details
Edit 2: The full FCM response:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
Huh, that explains why we're not seeing additional details. Interesting. I'll try a few test runs as well and see if I can duplicate. Thanks!
Issue #1373
Description
This is a really quick patch to try and capture the relevant details returned from FCM when it returns an INVALID_ARGUMENT error. I had thought it was related to the TTL, but we already trim it down to an appropriate max value.
Testing
Honestly, if I could figure out how to trigger this in dev, I'd be thrilled. As it is, to test this you'll need a valid FCM routing number, which means compiling an emulated FCM client app (the sample one works fine) which means updating Android Studio to 5, and fetching the latest updates, before altering the code paths and java code to match the FCM project you declared so that the downloaded google-services.json file tied to the sample app you declared in FCM match then use a combination of registration and send scripts to try to trigger an INVALID_ARGUMENT error that gets dumped out to sentry.
All for a patch to see what's going on, and not the real fix.
Issue(s)
Issue #1373