WIP feat(fcm): Add support for AndroidConfigV2 - #968
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces V2 configurations for Android messaging in the Firebase Admin Python SDK, including AndroidConfigV2, AndroidNotificationV2, AndroidRemoteNotification, and AndroidBackgroundSyncMessage, while deprecating the older V1 equivalents. The feedback highlights an issue where vibrate_timings_millis is documented to support datetime.timedelta instances, but the implementation only validates numbers. To resolve this, the reviewer suggests adding a helper method to validate both types, updating the encoder, and adjusting the test suite to verify this behavior.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the new AndroidConfigV2 and its associated V2 classes (AndroidNotificationV2, AndroidRemoteNotification, and AndroidBackgroundSyncMessage) to the FCM messaging module, while deprecating the older AndroidConfig and AndroidNotification implementations. It includes comprehensive encoding, validation logic, and unit tests. The review feedback highlights a few validation improvements: specifically, explicitly rejecting boolean values in check_vibrate_timings (since Python treats bool as a subclass of int/numbers.Number) and ensuring that all boolean fields in AndroidNotificationV2 are properly validated using _Validators.check_boolean.
…roidNotificationV2
This change implements support for the Android v2 API and it deprecates v1 AndroidConfig structures and replaces them with the new AndroidConfigV2 structures.
Adds AndroidConfigV2, AndroidNotificationV2, AndroidRemoteNotification, and AndroidBackgroundSyncMessage data classes.
Deprecates AndroidConfig and AndroidNotification.