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
Cannot connect on stream_chat_flutter: ^2.0.0-nullsafety.8 #524
Comments
Hi @TramPamPam |
Hi @imtoori We have system popup where we ask for some permissions that are required by our app logic while we connecting user to GetStream. It's right after we retrieved a token for user, that we use for connect method. Why does StreamChat tries to connect before we use connect user manually? |
ok apparently the system pop up makes the Can you enable the client logs with info level and paste it here? |
@imtoori
|
Hi @TramPamPam do you have the StreamChat widget on top of the Navigator/MaterialApp? |
Hi @imtoori Like this:
|
the merge pr should fix the issue |
This issue seems to have resurfaced in 3.3.2, |
Hi @akul1994 can you be more specific? I tested this behaviour and it's working fine for me |
In my app, when the user logs out, I call stream disconnect, and post login and make another call to connectUser with new user credentials. I put up a listener As a result, after login when I make a call to |
As a workaround, if after logout I reinstantiate the StreamClient object, I don't face this issue, but doing that is causing a few other things to break |
@akul1994 I'm testing this using our sample app and it's working fine |
Like this. So here are my findings,
|
@imtoori Any update on this? |
hey @akul1994 |
In m main.dart ,
|
Hey @imtoori any update on this, this is happening on every login, logout of the app, |
Hi @akul1994 I'm sorry but I was out sick |
Sure, I'll get something setup and get back to you. As a workaround, |
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away! Thanks for your contribution. |
Describe the bug
I receive an error after call
connectUser(User user, String token)
What package are you using? What version?
stream_chat_flutter: ^2.0.0-nullsafety.8
What platform is it about?
To Reproduce
Steps to reproduce the behaviour:
flutter: WebSocketError(message: You've called connect twice,
can only attempt 1 connection at the time,
)
Expected behaviour
Should connect to getstream
Screenshots
If applicable, add screenshots to help explain your problem.
**Logs **
#0 WebSocket.connect (package:stream_chat/src/ws/websocket.dart:175:7)
#1 StreamChatClient.openConnection (package:stream_chat/src/client/client.dart:330:24)
#2 StreamChatCoreState._onForeground (package:stream_chat_flutter_core/src/stream_chat_core.dart:178:14)
#3 StreamChatCoreState.didChangeAppLifecycleState (package:stream_chat_flutter_core/src/stream_chat_core.dart:165:9)
#4 WidgetsBinding.handleAppLifecycleStateChanged (package:flutter/src/widgets/binding.dart:692:16)
#5 ServicesBinding._handleLifecycleMessage (package:flutter/src/services/binding.dart:192:5)
#6 BasicMessageChannel.setMessageHandler. (package:flutter/src/services/platform_channel.dart:73:49)
#7 BasicMessageChannel.setMessageHandler. (package:flutter/src/services/platform_channel.dart:72:47)
#8 _DefaultBinaryMessenger.handlePlatformMessage (package:flutter/src/services/binding.dart:284:33)
#9 _invoke3. (dart:ui/hooks.dart:223:15)
#10 _rootRun (dart:async/zone.dart:1354:13)
#11 _CustomZone.run (dart:async/zone.dart:1258:19)
#12 _CustomZone.runGuarded (dart:async/zone.dart:1162:7)
#13 _invoke3 (dart:ui/hooks.dart:222:10)
#14 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:520:7)
#15 _dispatchPlatformMessage (dart:ui/hooks.dart:90:31)
Paste the output of running
flutter doctor -v
here.[✓] Flutter (Channel stable, 2.2.2, on Mac OS X 10.15.7 19H2 darwin-x64, locale en-UA)
• Flutter version 2.2.2 at /Users/user/flutter
• Framework revision d79295af24 (4 weeks ago), 2021-06-11 08:56:01 -0700
• Engine revision 91c9fc8fe0
• Dart version 2.13.3
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/user/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
✗ Android license status unknown.
Run
flutter doctor --android-licenses
to accept the SDK licenses.See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
[✓] VS Code (version 1.49.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.16.0
[✓] Connected device (2 available)
• iPhone 8 (mobile) • 36DDD3C7-8191-46B9-BC88-6FC909DEA1F5 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.114
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: