JetBrains-Discord-Integration icon indicating copy to clipboard operation
JetBrains-Discord-Integration copied to clipboard

java.io.IOException: Stream Closed

Open janek515 opened this issue 2 years ago • 2 comments

After having problems with 1.10.0 I cloned the repo and built directly from source. There still appears to be a problem. Upon launching nothing happens and rich presence is not shown. After clicking force reconnect the following error occurs:

Unhandled exception in [StandaloneCoroutine{Cancelling}@4f0b935a, Dispatchers.Default]

java.io.IOException: Stream Closed
	at java.base/java.io.RandomAccessFile.read0(Native Method)
	at java.base/java.io.RandomAccessFile.read(RandomAccessFile.java:365)
	at java.base/java.io.RandomAccessFile.readInt(RandomAccessFile.java:837)
	at dev.cbyrne.kdiscordipc.core.socket.impl.WindowsSocket.read(WindowsSocket.kt:38)
	at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler$events$1.invokeSuspend(SocketHandler.kt:35)
	at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler$events$1.invoke(SocketHandler.kt)
	at dev.cbyrne.kdiscordipc.core.socket.handler.SocketHandler$events$1.invoke(SocketHandler.kt)
	at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
	at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperatorImpl.flowCollect(ChannelFlow.kt:195)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo$suspendImpl(ChannelFlow.kt:157)
	at kotlinx.coroutines.flow.internal.ChannelFlowOperator.collectTo(ChannelFlow.kt)
	at kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelled}@4f0b935a, Dispatchers.Default]

Then after clicking force render update, rich presence is working as intended

janek515 avatar Dec 04 '22 10:12 janek515

I can reproduce the error and the workaround with 1.10.0+1

doluk avatar Dec 04 '22 11:12 doluk

This is a bug in kdiscordipc, see https://github.com/cbyrneee/KDiscordIPC/issues/15.

dnbln avatar Feb 05 '23 12:02 dnbln