Closed PrimeTimeTran closed 5 years ago
tests?
tests?
I can add them if they're required for a merge. I didn't feel confident writing them yet though because I'm not aware of all the edgecases.
Well, even a few that test positive and negative expectations. It’s not really for you, but whoever tries to use this function. Helps to clarify that it can take both an array and a single object. Usually the accepted practice with OSS in my experience.
Cheers!
On Jan 9, 2019, at 00:31, Loi Tran notifications@github.com wrote:
tests?
I can add them if they're required for a merge. I didn't feel confident writing them yet though because I'm not aware of all the edgecases.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Looks better than before but I think in the future the API needs a breaking change so that it doesn't throw if just one notif failed. Also there's no support for the async receipts API. The docs https://docs.expo.io/versions/latest/guides/push-notifications#http2-api and the JS reference are probably the best place to look https://github.com/expo/expo-server-sdk-node/blob/master/src/ExpoClient.ts
This PR resolves a datatyping error where the response is a
Hash
instead of anArray
.When the response object is an array, the current implementation works. However, there is a case in which the response is a
Hash
, in which case the methodResponseHandler.extract_data
grabs only the first
key => value
pair from the object in conjunction with turning it into an array, i.e.This results in an error being thrown in this method.
Screen shot of error:
Working implementation after update:
Please let me know if there's anything else you'd need to get this PR merged.
Thanks!