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

Continuous logging and unhandled exception #11

Closed
dxgiangdev3 opened this issue Aug 18, 2023 · 19 comments
Closed

Continuous logging and unhandled exception #11

dxgiangdev3 opened this issue Aug 18, 2023 · 19 comments

Comments

@dxgiangdev3
Copy link

dxgiangdev3 commented Aug 18, 2023

In your package, I tried to console log to check if the status code is equals to 200, and the result is that it's continuous log the print function.
In my use case, I have integrated your package to monitor changes in internet status, triggering UI components such as dialogs and snack bars through the whole app by using navigator context. But the problem is that the code won't stop after timeout. In that case, it would lead to an exception: [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'package:flutter/src/widgets/navigator.dart': Failed assertion: line 4516 pos 12: '!_debugLocked': is not true.
Am I missing something while using your package?

@OutdatedGuy
Copy link
Owner

Yo @dxgiangdev3, Can you elaborate on the issue and also share code snippets (Minimal Reproducible Sample) and also a video of the error.

@84rrry
Copy link

84rrry commented Aug 22, 2023

@OutdatedGuy any updates about the issue? it keeps throwing exceptions and showing that the network is unreachable , wouldn't it be better to handle it and just return false instead of throwing it.

@OutdatedGuy
Copy link
Owner

@84rrry, are you using custom addresses to check network connectivity or the default ones?

@84rrry
Copy link

84rrry commented Aug 22, 2023

@OutdatedGuy, both using custom and default addresses

@OutdatedGuy
Copy link
Owner

it keeps throwing exceptions and showing that the network is unreachable

Can you provide stack trace and error logs, cuz I have already implemented exception handling when trying to connect to a address.

@84rrry
Copy link

84rrry commented Aug 24, 2023

@OutdatedGuy Hello, sorry for the late reply it's hard to identify the exact problem or to get the full stack trace but this should help you identify the problem

IOClient.send (c:\Users\user\AppData\Local\Pub\Cache\hosted\pub.dev\http-1.1.0\lib\src\io_client.dart:121)
<asynchronous gap> (Unknown Source:0)
BaseClient._sendUnstreamed (c:\Users\user\AppData\Local\Pub\Cache\hosted\pub.dev\http-1.1.0\lib\src\base_client.dart:93)
<asynchronous gap> (Unknown Source:0)
_withClient (c:\Users\user\AppData\Local\Pub\Cache\hosted\pub.dev\http-1.1.0\lib\http.dart:166)
<asynchronous gap> (Unknown Source:0)
Future.timeout.<anonymous closure> (dart:async/future_impl.dart:0)
<asynchronous gap> (Unknown Source:0)

Screenshot 2023-08-24 113046

_NativeSocket.lookup.<anonymous closure> (dart:io-patch/socket_patch.dart:520)
<asynchronous gap> (Unknown Source:0)
_NativeSocket.staggeredLookup.<anonymous closure>.lookupAddresses.<anonymous closure> (dart:io-patch/socket_patch.dart:0)
<asynchronous gap> (Unknown Source:0)

image

@OutdatedGuy
Copy link
Owner

@dxgiangdev3 @84rrry on what Flutter version are you guys on?

@OutdatedGuy
Copy link
Owner

Looks like the issue is with the latest Dart SDK that comes with Flutter 3.13: dart-lang/sdk#53334

@84rrry
Copy link

84rrry commented Aug 28, 2023

@dxgiangdev3 @84rrry on what Flutter version are you guys on?

@OutdatedGuy i'm using

- Flutter: 3.10.3
- Dart: 3.0.3

@84rrry
Copy link

84rrry commented Aug 28, 2023

Looks like the issue is with the latest Dart SDK that comes with Flutter 3.13: dart-lang/sdk#53334

Yep i think you're right , dart-lang/sdk#53331 is related too , i'll attempt to downgrade temporarily if possible hoping that this will be fixed soon

@OutdatedGuy
Copy link
Owner

Flutter 3.13.4 with Dart 3.1.2 fixes the issue.

@84rrry
Copy link

84rrry commented Sep 18, 2023

@OutdatedGuy Hello , can you please reopen this as the issue still persist

@84rrry
Copy link

84rrry commented Sep 18, 2023

This was the call stack:

_ConnectionTarget.connect.<anonymous closure>.<anonymous closure> (dart:_http/http_impl.dart:2533)
_RootZone.runUnary (dart:async/zone.dart:1661)
_FutureListener.handleError (dart:async/future_impl.dart:174)
Future._propagateToListeners.handleError (dart:async/future_impl.dart:852)
Future._propagateToListeners (dart:async/future_impl.dart:873)
Future._completeError (dart:async/future_impl.dart:649)
Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:739)
_microtaskLoop (dart:async/schedule_microtask.dart:40)
_startMicrotaskLoop (dart:async/schedule_microtask.dart:49)

image

@OutdatedGuy
Copy link
Owner

@84rrry can you provide output of flutter doctor -v and flutter run -v

@OutdatedGuy OutdatedGuy reopened this Sep 21, 2023
@84rrry
Copy link

84rrry commented Nov 2, 2023

Hey @OutdatedGuy , sorry i got a lil busy and lost track of the notification . here's the flutter doctor -v output :
`[√] Flutter (Channel stable, 3.13.9, on Microsoft Windows [Version 10.0.22621.2506], locale en-US)
• Flutter version 3.13.9 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision d211f42860 (8 days ago), 2023-10-25 13:42:25 -0700
• Engine revision 0545f8705d
• Dart version 3.1.5
• DevTools version 2.25.0

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at C:\Android
• Platform android-33, build-tools 33.0.2
• ANDROID_HOME = C:\Android
• Java binary at: C:\Program Files\Java\jdk-18.0.2.1\bin\java
• Java version Java(TM) SE Runtime Environment (build 18.0.2.1+1-1)
• All Android licenses accepted.

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] VS Code (version 1.84.0)
• VS Code at C:\Users\Barry\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.76.0

[√] Connected device (1 available)
• Pixel 6a (mobile) • 29061JEGR11086 • android-arm64 • Android 14 (API 34)

[√] Network resources
• All expected network resources are available.

! Doctor found issues in 1 category.`

@OutdatedGuy
Copy link
Owner

Weird issue, will check up on it

@84rrry
Copy link

84rrry commented Nov 19, 2023

@OutdatedGuy It's pretty annoying, I had to implement my own alternative . However i'll happily provide you with further information/help

@OutdatedGuy
Copy link
Owner

Can you provide the crash logs while running the command flutter run -v.

@84rrry
Copy link

84rrry commented Nov 21, 2023

@OutdatedGuy , I wanna inform you that the issue stopped happening after updating flutter to the latest version here's my flutter doctor -v output:
[√] Flutter (Channel stable, 3.16.0, on Microsoft Windows [Version 10.0.22621.2715], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[!] Android Studio (not installed)
[√] VS Code (version 1.84.2)
[√] Connected device (1 available)
[√] Network resources

! Doctor found issues in 1 category.
I think you it's safe to go ahead and close the issue , as i can't reproduce it anymore at least on my end .

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

No branches or pull requests

3 participants