timehop / apns

A Go package to interface with the Apple Push Notification Service
https://godoc.org/github.com/timehop/apns
MIT License
185 stars 47 forks source link

Provide Feedback Service Errors to Clients. #6

Closed taylortrimble closed 1 year ago

taylortrimble commented 10 years ago

Similar to, but not a duplicate of, #3. #3 is about not knowing the reason a client has disconnected; this issue is about not knowing the reason the feedback service disconnected.

I'm currently experiencing issues connecting to the feedback service, but my gateway is working fine. I haven't been able to inspect the reason from the lib.

taylortrimble commented 10 years ago

Also worth noting is that the feedback service does not have built in retry like the gateway does in this library. For that reason, it may be worth it to differentiate between errors that are expected to be temporary (like no network connection) and errors that are expected to be permanent (malformed certificate).

taylortrimble commented 10 years ago

I just learned that the feedback connection is not intended to be persistent like the gateway. That might be worth noting somewhere!

I still also like the idea of reporting errors back.

taylortrimble commented 9 years ago

I'm still interested in receiving other errors; worth re-opening to track that? We can ignore EOF from closed connections.

bdotdub commented 9 years ago

Ah yes. You're right. Going to reopen.

What feels cleaner:

  1. Having a feedback channel and an error channel
  2. Having a channel for FeedbackResult that possibly includes an error
  3. Avoid channels entirely and have the caller call Read() (*Feedback, error) and manually deal with nil (ie. no more tokens) or errors
taylortrimble commented 9 years ago

I like 1, personally. I don't like 3 if I have to call it repeatedly until I get nil. Good options.