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

Manual cancellation of in-flight operations #1383

Merged
merged 3 commits into from
Sep 10, 2020
Merged

Conversation

designatednerd
Copy link
Contributor

This should address #1376 - when a session was being invalidated, its in-flight tasks weren't being cancelled before being removed from the list of active tasks on URLSessionClient. Why not, since we were calling invalidateAndCancel, which is supposed to cancel active tasks? Turns out there's one verrrry important piece of information that only lives on the web docs:

Screen Shot 2020-09-08 at 1 58 23 PM

Now, we're going through and actually cancelling all the tasks that are from the URLSessionClient before clearing out the array of active tasks. That should prevent tasks from calling back at a point where the assertion failure being hit in #1376 gets hit.

@designatednerd
Copy link
Contributor Author

@RolandasRazma You wanna give this a shot and see if it resolves your issues?

@RolandasRazma
Copy link
Contributor

wasn't it simpler to remove assert? :)
sure will check, thanks for looking into it

@designatednerd
Copy link
Contributor Author

I definitely considered sending that to a debugPrint rather than an assert, but the assert is there to tell me things ain't working the way they're supposed to (while allowing things to fail more gracefully in prod).

@designatednerd
Copy link
Contributor Author

@RolandasRazma any improvement?

@RolandasRazma
Copy link
Contributor

RolandasRazma commented Sep 10, 2020 via email

@designatednerd
Copy link
Contributor Author

Cool, I'm gonna merge this and do a patch release then

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

Successfully merging this pull request may close these issues.

2 participants