-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fixed #5285 fatalError when connection was lost immediately after sending r… #5286
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
base: main
Are you sure you want to change the base?
Conversation
|
I can confirm this really happens. We had to patch it in our fork almost same way. We're using Just nitpicking here, @jollyjinx, would you mind adjusting indentation? Alignment by first argument, like in similar error below your lines. |
|
@swift-ci please test |
|
@guoye-zhang please review |
guoye-zhang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks fine, but would be good to figure out how to reproduce this since there might be an underlying bug of the response getting lost
|
@guoye-zhang should we merge this? |
| fatalError("Transfer completed, but there's no response.") | ||
| internalState = .transferFailed | ||
| let error = NSError(domain: NSURLErrorDomain, code: NSURLErrorNetworkConnectionLost, | ||
| userInfo: [NSLocalizedDescriptionKey: "The network connection was lost."]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the message in the error description?
| userInfo: [NSLocalizedDescriptionKey: "The network connection was lost."]) | |
| userInfo: [NSLocalizedDescriptionKey: "Transfer completed, but there's no response."]) |
|
Left a minor comment, otherwise looks good to merge |
fixes #5285
I tried to write a test case, but it's a hard to reproduce error as it will not happen when just closing the connection from the server side. But as it happens in the wild and crashes it should behave correctly with this fix.