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

Add tests for client aborted requests. #79

Closed
jaydenseric opened this issue May 23, 2018 · 0 comments
Closed

Add tests for client aborted requests. #79

jaydenseric opened this issue May 23, 2018 · 0 comments

Comments

@jaydenseric
Copy link
Owner

jaydenseric commented May 23, 2018

It would be a really awesome thing to have automated tests for this; because it is pretty tricky to handle right and the last thing we want is for GraphQL servers to crash every time an impatient user presses the browser's back button while waiting for a large upload.

We need to be able to abort at specific moments of the processing to test:

  • Upload scalar promises reject with an UploadPromiseDisconnectUploadError when the request disconnects before their file upload stream has begun parsing.
  • Resolved file upload streams emit the error event with FileStreamDisconnectUploadError when the request disconnects while the stream is being parsed.

It would be great to also clarify/test what happens when the request is aborted before the first multipart field (operations) is finished parsing.

In the last year I (@AdamYee also helped) spent perhaps over a week's worth of effort trying various approaches to simulate client aborted uploads, and always gave up and tested it manually using apollo-upload-examples with the network speed throttled down via the Chrome dev tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant