urbanairship / android-library

Urban Airship Android SDK
Other
112 stars 123 forks source link

ChannelRegistrationPayload not properly (de)serialized #44

Closed stephan-mediamonks closed 7 years ago

stephan-mediamonks commented 7 years ago

Issue: The class com.urbanairship.push.ChannelRegistrationPayload serializes itself to JSON in the method toJsonValue() by utilizing the JsonMap class. This class skips empty properties. If the 'alias' property is an empty String, it will not be set in the resulting JSON string. When deserializing in the parseJson() method, the 'alias' property is set to null since it's not present in the JSON string as stored in the SharedPreferences.

The net result of this is that in the class com.urbanairship.push.PushManagerJobHandler the method shouldUpdateRegistration() always returns true, even if the payload that was received, should be regarded as the same as the payload that was stored.

This effectively results in the channel being updated way too often.

rlepinski commented 7 years ago

Thanks for the report! We will have this fixed today.

rlepinski commented 7 years ago

Fixed in 8.9.6