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

Bug: App crashs when in flight mode or without connection #3

Open
ozzfelipe opened this issue Apr 17, 2024 · 1 comment
Open

Bug: App crashs when in flight mode or without connection #3

ozzfelipe opened this issue Apr 17, 2024 · 1 comment

Comments

@ozzfelipe
Copy link

ozzfelipe commented Apr 17, 2024

When we have all connection
When we switch the device to flight mode, the lib app is crashing.

Tested in Android emulators and physical device.

package version: 1.0.8
Log event:
FATAL EXCEPTION: DefaultDispatcher-worker-4 Process: example.app, PID: 12342 java.lang.ClassCastException: java.net.UnknownHostException cannot be cast to java.util.Map at io.dyte.socketio.engine.EngineSocket.onError(socket.kt:534) at io.dyte.socketio.engine.EngineSocket$setTransportInternal$3.invoke(socket.kt:200) at io.dyte.socketio.engine.EngineSocket$setTransportInternal$3.invoke(socket.kt:200) at io.dyte.socketio.EventEmitter.emit(EventEmitter.kt:23) at io.dyte.socketio.engine.transport.WebSocketTransport$doOpen$1.invokeSuspend(websocket_transport.kt:65) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@66d14c1, Dispatchers.Default]

Is there any solution for this?

@maximborodkin
Copy link

Faced the same issue. Wrapping the connect() method in try/catch doesn't work because the exception is thrown in a coroutine inside the library code.
I found that WebsocketTransport emits an error event with Exception at line 65. But EngineSocket expects String or Map<String, String> instead of Exception in the onError() method on line 529.

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

2 participants