-
Notifications
You must be signed in to change notification settings - Fork 738
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
Remove manual task clearing in URLSessionClient invalidate #1443
Conversation
URLSession.shared is not being used, calling invalidateAndCancel prior to cleaning up tasks works.
@philfi: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
The problem is that while we're not using That said, if you want to break it out so that the manual cancellation only happens when the shared session config is the config, that could probably work. |
ah had missed that the I'll do some testing with that case to get familiar but my hope is this logic should cover both that and the case of an injected config, which pretty consistently triggers this assertion failure for me at least. Will also take a look into the test failures on macOS, had them passing locally running 10.15.4. |
I wouldn't worry too much about the test failures, the tests that are failing are flaky as hell |
@philfi Have you had a chance to try to update this or do you mind if I take it over? |
@designatednerd apologies I have not, feel free to take it over! |
Ooh! OK so working on this when I set it up to do the extra work if The docs for
So I think your approach is actually the correct one, and we don't need to bother with manual task cancellation. Poking CI, will merge if it passes. |
Thanks @designatednerd! |
Just FIY still happening in 0.36.0 (iOS12 simulator) |
This resolves assertion crashes that are still occurring as described in this issue #1376 (comment) despite the fix introduced in #1383.
In theory since
URLSession.shared
is not being used, there shouldn't be a need for any manual task clearing. In my testing callinginvalidateAndCancel
prior to cleaning up tasks seems to consistently do the trick.