Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix usage of deprecated FCM call causing failures.
The "sendMulticast()" function has been deprecated, and in fact the way this function used to work is no longer supported server-side by Firebase. This was causing sendMulticast() to fail *silently*, since it doesn't throw exceptions upon failure, but returns a list of successful and unsuccessful responses. In our code, we don't really check the reason for the failure, and just proceed to invalidate the associated device token, assuming that it's no longer valid. This updates our code to use the newly recommended sendEachForMulticast() function, which is not exactly a drop-in replacement, since it doesn't actually send a single multicast message, but rather multiple messages. Nevertheless it uses an HTTP/2 connection, so performance should not be impacted significantly. This also adds a little more logging upon failure, and bumps the minimum version of the Firebase dependency, and tidies up tests. It's not really clear what exactly the test was testing (since it didn't catch this failure). Expanding tests is something to visit in the future. https://firebase.google.com/support/release-notes/admin/node#version_1170_-_18_april_2023 firebase/firebase-admin-node#2488 Bug: T379068 Change-Id: I6db51687bf1a16c15a274a21df1d472c2b349ea9
- Loading branch information