Skip to content

Don’t call didReceiveError twice if deadline is exceeded and request is canceled afterwards #609

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

Merged

Conversation

dnadoba
Copy link
Collaborator

@dnadoba dnadoba commented Aug 4, 2022

Motivation

If the deadline is exceeded and the connection state machine fails the request with an error, we forgot to transition to the finished state in the RequestBag. A symptom of this is that a request could afterwards still be canceled from user code and it would trigger a second call to the delegates didRecieveError method.

Modification

  • transition to the finished state
  • add a test which fails without the change above

Result

didReceiveError can't be called twice

@dnadoba dnadoba added the 🔨 semver/patch No public API change. label Aug 4, 2022
@Lukasa Lukasa merged commit 3960678 into swift-server:main Aug 4, 2022
@dnadoba dnadoba deleted the dn-fix-cancel-after-deadline-exceeded branch August 4, 2022 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants