<@U037PBJHYP8> I'm working on a Compose Multiplat...
# kotlinx-rpc
y
@Alexander Sysoev I'm working on a Compose Multiplatform desktop app (Kotlin 2.3.0, kotlinx-rpc 0.10.2, Ktor 3.4.1) that communicates with a Ktor server using kRPC. I've verified the server works correctly — I can hit REST test endpoints and the database operations all succeed via curl. The problem is specifically with the kRPC client in the Compose module. When I attempt to make an RPC call, the WebSocket connection upgrades successfully — I can see
101 Switching Protocols
in the client logs — and the service proxy is created via
withService<MyService>()
without error. However, the actual method call never returns. It just hangs until my timeout fires. The server logs show the WebSocket connection is accepted, but it appears no kRPC protocol frames ever arrive on the server side. Client log output:
Copy code
Info:  Creating new RPC connection to <http://127.0.0.1:8081/api>
Debug: REQUEST: <ws://127.0.0.1:8081/api> — METHOD: GET
Debug: RESPONSE: 101 Switching Protocols — FROM: <ws://127.0.0.1:8081/api>
// ... then nothing — call hangs until timeout or scope cancellation
Source code: - RpcClientProvider.kt -Application.kt (server) - App.kt -DI.kt
a
Hey @Yassine Abou! I'll take a look at this, thanks for the report!
You have quite a big project, can you please make a minimal reproducer?
a
I once had the same problem. IIRC, I figured out that server was closing the websocket connection early While you can ensure your websocket connection remains active, it'll be easier if kRPC at least throws a ConnectionException instead of hanging indefinetly
y
Hi @Alexander Sysoev, I'll create a new repository and share the link soon
thank you color 1
I created the repository, but when I set up the Ktor client directly in the Compose app and even when I tried to replicate the exact structure of my project with RpcClientProvider, Kodein DI, and RemoteDataSource, everything works fine
So the issue isn't reproducible in isolation, which means it's something specific to my full project that I haven't been able to define yet
Does anyone have suggestions on how to debug this ? here is the Here's the link of the repo anyway: https://github.com/yassineAbou/demo
Hi, @Alexander Sysoev ، It turn out gradle 9 what caused the issue. I downgraded to gralde 8 and everything works now
a
This is extremely strange I must say
Maybe some dependency changed its version when you downgraded/or just coincidentally at the same time?
y
I really don't know