[Vortex] GCM response

Review Request #153 — Created Sept. 23, 2013 and submitted

dinos
Lunr
dinostheo:GCMResponse
156
lunr
A GCM Response wrapper and error handler.
unit tests
  • 0
  • 0
  • 10
  • 0
  • 10
Description From Last Updated
pprkut
  1. 
      
  2. src/Lunr/Vortex/GCM/GCMResponse.php (Diff revision 1)
     
     
    In the case of Android the endpoint is the device ID, no?
    1. no the device ID or the device IDs are included in the payload.
      The endpoint here is the post url "https://android.googleapis.com/gcm/send"
    2. Ok, minor misconception there. The "endpoint" is where the notification ends up, aka the device of the user, not the webservice of the distribution server. Depending on the transport this can be either identified by a URL (MPNS), device ID (APNS, GCM), a phone number (SMS), an email address (Email), etc.
  3. src/Lunr/Vortex/GCM/GCMResponse.php (Diff revision 1)
     
     
     
     
    MPNS uses ERROR for 400. I don't really see the necessity to introduce a new error enum. Invalid input is not usually something the user can influence since it would be a bug in our generators.
    They could opt to not use our generators and supply it themselves, but then they'd have details in the logs anyway.
  4. src/Lunr/Vortex/GCM/GCMResponse.php (Diff revision 1)
     
     
    This says nothing to the user. We want the error message in the logs, not (only) the number.
  5. 
      
dinos
pprkut
  1. 
      
  2. src/Lunr/Vortex/GCM/GCMResponse.php (Diff revisions 1 - 2)
     
     
    The documentation hints at those messages already being available in the error response. I guess it would be best to fetch them from there rather than creating our own ones.
  3. 
      
dinos
dinos
pprkut
  1. 
      
  2. src/Lunr/Vortex/GCM/GCMResponse.php (Diff revision 4)
     
     
    you effectively decode the result twice. I think it would make more sense to decode it in the constructor and always work with the decoded one, no?
  3. src/Lunr/Vortex/GCM/GCMResponse.php (Diff revision 4)
     
     
     
     
     
     
     
     
     
     
     
     
    I don't really understand the usecase of this. Can you elaborate?
  4. src/Lunr/Vortex/GCM/GCMResponse.php (Diff revision 4)
     
     
     
     
     
     
     
     
     
     
     
    nitpick. I think if you split out the foreach it becomes a little more readable
  5. assertPropertySame
  6. assertPropertySame
  7. assertPropertySame
  8. tests/statics/Vortex/gcm_response.txt (Diff revision 4)
     
     
     
     
     
     
     
     
     
     
    Can you run that through a pretty printer? :)
  9. tests/statics/Vortex/gcm_response_error.txt (Diff revision 4)
     
     
     
     
     
     
     
     
     
     
     
  10. 
      
dinos
leo
  1. Ship It!
  2. 
      
dinos
Review request changed

Status: Closed (submitted)

Change Summary:

Merged into master
Loading...