-
Notifications
You must be signed in to change notification settings - Fork 16
DioError : HttpException: Connection closed before full header was received #8
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
Comments
Hi there! Thanks for reporting the issue. Can you please provide what version of PubNub are you using? Also, if its possible, it would be great if you could include a snippet of code that contains |
Thanks, Are. I'm experiencing this exception when running PubNub Dart SDK versions 1.1.0 or 1.1.3. My code is something like this inside of an async function:
When attempting to send pubnub notifications to that channel, I'm not seeing any print messages in the debug console. The DioError HttpException occurs at line 963 of dio.dart. |
Hello, Are. Any status on this problem? |
So I am trying to replicate this but had no luck - is it possible that you are trying to resubscribe multiple times very quickly? It seems like it tries to subscribe again before the previous request has been sent and Dio throws an uncatchable error. Can you create a minimum replicable example? |
Based on your message, I checked my code and found that it was calling the subscription code two or three times before the first one completed. I tested for this and now it only does subscription once. However, the Dio exception still happens at odd times. I don't have time to make a minimum replicable example because I'm trying to rollout a new version of our app. |
So upon further investigation this is an issue with the Dio library - it cannot handle cancelling the request if the previous one hasn't been sent fully. This is hard to replicate, but I will be working on a fix (and possibly removing the Dio dependency altogether). Sorry for such a long wait! |
Thank you. Please update here again if and when you can replace Dio with something else. Much appreciated. |
We are facing the same problem, upon login, it throws exactly the same exception. Closure: (dynamic, [RequestOptions]) => DioError from Function 'assureDioError':. message=Connection closed before full header was received Let us know if additional details from us can help, we are ok to show the entire code flow via an interactive session if it helps. Here is some reading we had done on this error: Also, we are facing one more issue which we think may be causing the connection to close while the app is running, while debugging we got this exception but as of now, we don't have a full trace of from where it is coming. Do we need to something like this ourselves OR this is done in PubNub SDK already? |
There is an issue with Dio that we cannot be easily resolved. I am working on removing the Dio dependency altogether, but for that I need dart-lang/sdk#41904 to land first. It should happen until the end of the month. Also, to prevent this issue, make sure to not call subscribe unguarded in a widget and try to avoid making fast resubscribes (like having multiple updates that trigger resubscription). If this problem will be blocking you from further development, please contact our support team to setup an interactive session or a call and I will be happy to join in! |
Good news! dart-lang/sdk#41904 has already landed, but its in the beta channel. I have begun the development of a networking module without Dio already, but it will have to wait for release until this feature lands in stable. Sit tight! |
Already Solved With All Possible Solution added [Solved] How to fix HttpException: Connection closed before full header was received |
We have removed |
i m facing same issue but unable to resolve it [ +263 ms] ensureAnalyticsSent: 255ms |
plz help me out |
Sry, this link can not be opened. |
Running in an emulator, my Flutter app occasionally there will be an exception thrown:
I understand that Dio is a dependency of this package. Do you have a working Flutter app example with code on Github that I can take a look at to see how to get past this DioError?
Flutter Doctor:
The text was updated successfully, but these errors were encountered: