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

Missing docs about aborted requests for V3 #9882

Open
bohdanbirdie opened this issue Jul 5, 2022 · 6 comments
Open

Missing docs about aborted requests for V3 #9882

bohdanbirdie opened this issue Jul 5, 2022 · 6 comments

Comments

@bohdanbirdie
Copy link

After upgrading to Apollo Client V3 - all the unmounted queries are aborted, which throws an error

  • Message: The user aborted a request.
  • Message: Fetch is aborted
  • Message: The operation was aborted.

This is causing a lot of noise in the FE monitoring tools like raygun and etc (#6769)

Looks like the docs are missing info about this change, I could not find it in either migration guide or in the docs search.

One of the users mentioned that passing the abort controller to the HTTP link helps, but has side effects.
#6769 (comment)

With the abort controller passed - the requests are not aborted anymore, and no errors are thrown.

But is this the expected behavior? What is the right way to prevent abort errors to be thrown without breaking internal logic of the apollo client?

@bohdanbirdie
Copy link
Author

@jpvajda hi!
Is there anybody from the team available to give an update on this? Just wondering if there is a right way to do it, and still can't find the right solution

@jpvajda
Copy link
Contributor

jpvajda commented Jul 26, 2022

@bohdanbirdie 👋 I've added this issuer #6711 which is an umbrella issue for misc documentation updates that the team is currently iterating through. We accept PRs for our docs so if you wanted to make some improvements feel free to submit something and we can review. Thanks for being patient on this request!

@bignimbus
Copy link
Contributor

Hi @bohdanbirdie 👋🏻 I'm taking a look at this. May I ask a follow-up about this statement?

This is causing a lot of noise in the FE monitoring tools like raygun and etc

The linked issue mentions LogRocket but it appears that there's a broken URL so I don't have access to the full context. Can you explain why you named Raygun? Is there an issue or other artifact we can reference?

@bohdanbirdie
Copy link
Author

Hey @bignimbus
That link is from someone else as I can see, could be outdated

We did a fix on our side, for now, to remove the noise from this issue. Our UI is using Raygun for error logging. There is an hook called onBeforeSend, using it I can ignore the AbortError error, effectively stopping the reports for canceled requests.

It works, with a catch, all canceled request errors would be ignored, regardless if this is an Apollo or not. Works for us, but might not some someone else.

@bignimbus
Copy link
Contributor

Thanks for the quick reply @bohdanbirdie! I'm glad that you were able to get things sorted out for that specific scenario. To help developers in the future do you have any suggestions for adding content to the Migration Guide or perhaps the Apollo HTTP Link doc? I'm not sure we would want to suggest using AbortController considering the potential side effects noted by @luin but maybe we could add a more general note about query cancellation in Apollo Client?

@bohdanbirdie
Copy link
Author

@bignimbus sorry, just noticed your message
Out fix is quite specific and does not modify the apollo client in any way

For me it still looks like it would make sense to add docs about the AbortController, but I don't exactly know what has changed in the Apollo v3 regarding that

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

3 participants