ileitch/rapns — pull request #184 by jakeonfire (2013-12-05 02:20:51+00:00)
Title: add individual GCM success ad failure reflections per recipient. reorganize Gcm::Delivery class and specs.

re: Gcm::Delivery reorganization:
the primary goal was to make code paths easier to follow in the case of a complete success, complete network fail/retry, and partial success/failure (lines 53-64). even within these there are overlapping concerns, so the processing of the result data is unified into a new structure optimized for the different processing requirements - this happens first (lines 50-51). from there the conditions leading to different side-effects are clearer. for example, there is now only one place where a DeliveryError is raised after a 200 response and one place where most of the error messages are generated for that.
the only functional change - apart from the two new reflections - is that in the case where all failures were invalid ids it used to mark the delivery as failed but not raise a DeliveryError - now it raises the error. also these error results are included in the error messages like ay others. the original behavior seemed incongruous and resulted in additional complexity. i can see a case for doing this so that one is effectively treating this class of errors (INVALID_REGISTRATION_ID_STATES) one way and others another way, but the UNAVAILABLE_STATES class of errors should then also be treated separately...