-
Notifications
You must be signed in to change notification settings - Fork 98
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
[BUG] Crash upon starting listening for real time chat events #862
Comments
@CHILIU-MSFT would you mind taking a look? Thanks! |
Hi @LosDanieloss , thanks for feedback! The design is startRealtimeNotifications need to be called before addEventHandler. this.startRealtimeNotifications(userAccessToken, context) Besides, we'll look into the Log tag exceeds limit issue. Thanks for reporting the bug! |
Hi @CHILIU-MSFT I am working on the same application as @LosDanieloss . I’ve checked our original code in the app and this.startRealtimeNotifications and this.addEventHandler are already called in the order you wrote. It looks like as Daniel wrote that our problem for Android < 8.0 is tag length. We're looking forward for the fixed version. |
Hi @LosDanieloss, @michal-softwarehut. I did some research and it looks like we cannot remove the tag limit since it resides in the Android API |
Describe the bug
To long Log tag on Android running <= API 25
Exception or Stack Trace
E/AndroidRuntime( 7159): Caused by: java.lang.IllegalArgumentException: Log tag "com.azure.android.communication.chat.ChatAsyncClient" exceeds limit of 23 characters
E/AndroidRuntime( 7159):
E/AndroidRuntime( 7159): at android.util.Log.isLoggable(Native Method)
E/AndroidRuntime( 7159): at com.azure.android.core.logging.implementation.DefaultLogger.isErrorEnabled(DefaultLogger.java:233)
E/AndroidRuntime( 7159): at com.azure.android.core.logging.ClientLogger.logThrowableAsError(ClientLogger.java:225)
E/AndroidRuntime( 7159): at com.azure.android.core.logging.ClientLogger.logExceptionAsError(ClientLogger.java:209)
E/AndroidRuntime( 7159): at com.azure.android.communication.chat.ChatAsyncClient.addEventHandler(ChatAsyncClient.java:285)
E/AndroidRuntime( 7159): at com.microsoft.pulsyksometr.pulsyksometr_app.acs.AcsIntegration$chatClient$2.invoke(AcsIntegration.kt:81)
E/AndroidRuntime( 7159): at com.microsoft.pulsyksometr.pulsyksometr_app.acs.AcsIntegration$chatClient$2.invoke(AcsIntegration.kt:18)
E/AndroidRuntime( 7159): at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
E/AndroidRuntime( 7159): at com.microsoft.pulsyksometr.pulsyksometr_app.acs.AcsIntegration.getChatClient(AcsIntegration.kt)
E/AndroidRuntime( 7159): at com.microsoft.pulsyksometr.pulsyksometr_app.acs.AcsIntegration.access$getChatClient$p(AcsIntegration.kt:18)
E/AndroidRuntime( 7159): at com.microsoft.pulsyksometr.pulsyksometr_app.acs.AcsIntegration$getDirectMessages$1.subscribe(AcsIntegration.kt:232)
E/AndroidRuntime( 7159): at io.reactivex.internal.operators.single.SingleCreate.subscribeActual(SingleCreate.java:39)
E/AndroidRuntime( 7159): at io.reactivex.Single.subscribe(Single.java:3603)
E/AndroidRuntime( 7159): at io.reactivex.internal.operators.single.SingleObserveOn.subscribeActual(SingleObserveOn.java:35)
E/AndroidRuntime( 7159): at io.reactivex.Single.subscribe(Single.java:3603)
E/AndroidRuntime( 7159): at io.reactivex.Single.subscribe(Single.java:3589)
E/AndroidRuntime( 7159): at io.reactivex.Single.subscribe(Single.java:3559)
E/AndroidRuntime( 7159): at com.microsoft.pulsyksometr.pulsyksometr_app.acs.AcsInitializer$setup$1.onMethodCall(AcsInitializer.kt:191)
E/AndroidRuntime( 7159): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/AndroidRuntime( 7159): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/AndroidRuntime( 7159): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:692)
E/AndroidRuntime( 7159): at android.os.MessageQueue.nativePollOnce(Native Method)
E/AndroidRuntime( 7159): at android.os.MessageQueue.next(MessageQueue.java:143)
E/AndroidRuntime( 7159): at android.os.Looper.loop(Looper.java:122)
E/AndroidRuntime( 7159): ... 5 more
To Reproduce
Add code snippet found below to your App and connect. Important bit is adding event handler to receive real time notification. Then just launch the App & send some message to that user. That should create the crash I believe.
Code Snippet
ChatClientBuilder()
.endpoint(endpoint)
.credential(CommunicationTokenCredential(userAccessToken))
.buildAsyncClient().apply {
val notificationCallback =
RealTimeNotificationCallback { chatEvent -> }
this.addEventHandler(ChatEventType.CHAT_MESSAGE_RECEIVED, notificationCallback)
this.startRealtimeNotifications(userAccessToken, context)
}
Expected behavior
App won't crash & will be able to listen to new messages.
Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
Build #AI-203.7717.56.2031.7621141, built on August 7, 2021
Runtime version: 11.0.10+0-b96-7249189 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 5.4.0-58-generic
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 8
Registry: external.system.auto.import.disabled=true, ide.images.show.chessboard=true
Non-Bundled Plugins: com.bloc.intellij_generator_plugin, Dart, com.localizely.flutter-intl, org.jetbrains.kotlin, io.flutter, org.intellij.plugins.markdown
Current Desktop: X-Cinnamon
The text was updated successfully, but these errors were encountered: