Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for errors from Apple #40

Open
nathany opened this issue Apr 21, 2015 · 4 comments
Open

Tests for errors from Apple #40

nathany opened this issue Apr 21, 2015 · 4 comments

Comments

@nathany
Copy link
Contributor

nathany commented Apr 21, 2015

I'd like some tests for errors from Apple but without actually hitting Apple's servers in the test suite.

Status code Description
0 No errors encountered
1 Processing error
2 Missing device token
3 Missing topic
4 Missing payload
5 Invalid token size
6 Invalid topic size
7 Invalid payload size
8 Invalid token
10 Shutdown
255 None (unknown)

I'm thinking about mockConn having a special device token that results in 8 Invalid token, or that sort of thing. A bit like test credit cards.

My thought is to only do this for tests within the apns package, not impacting the callers of this library in any way.

@nathany
Copy link
Contributor Author

nathany commented Apr 21, 2015

Of course we also need to get a better feel for how errors from Apple occur in real life (readErrors). Using a production device token with a sandbox cert setup should do the trick.

@nathany
Copy link
Contributor Author

nathany commented Apr 23, 2015

Validations before sending data should be able to prevent a good number of these.

Still, there are errors that can occur at any time.

@taylortrimble
Copy link
Contributor

I think I'd prefer having a connection that satisfies the interface, but is initialized with a specific status code to return. Seems more explicit.

@nathany
Copy link
Contributor Author

nathany commented Apr 30, 2015

True.

We should be able to use validations to avoid errors 2-8. I would like to separate out the preparation of the data to send Apple from the actual sending.

@nathany nathany mentioned this issue Apr 30, 2015
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants