Open jhoughjr opened 1 year ago
I have the same bug. Is there a fix in the pipeline or a workaround ?
I am getting into almost the same trouble. Only the backtrace points to a different file and line in NIOCore. It happens on localhost during development as well as on Heroku where I host the application. I have also found out that ti started happening from version 2.13.0 so I am for now staying with 2.12.1 specified in package manifest.
Same here using websocket-kit as a client.
Facing the same bug. Any update on a fix/workaround?
i had the same issue when i was accidentally mixing escaping closure syntax and async/await in my websocket routes. fixing that fixed the problem for me
You should be able to wrap your onText
etc calls inside an event loop submit or similar to remove. But we are working on this and trying to fix the underlying issue
i had the same issue when i was accidentally mixing escaping closure syntax and async/await in my websocket routes. fixing that fixed the problem for me
Hey, thanks a ton! Your tip about not mixing up escaping closures with async/await was spot-on. I wrapped my async/await stuff in a Task { ... }, and this fixed the issue.
Describe the bug
I'm seeing a precondition failed when setting onText or onBinary on an upgraded websocket.
To Reproduce
vapor new testing; cd testing; open Package.swift;
add the following route to routes.swift
Build and run. Then connect to ws://localhost:8080/test with a websocket client. When the onText handler is added, the server will crash with precondition failed.
Expected behavior
A properly added onText or onBinary handler that does not fail the box's precondition and crash.
Environment
MacOS 13.4, m1 Mac mini 2020 Xcode 14.3.1 Vapor: 4.77.0 toolbox: 18.7.1 websocket-kit: 2.14.0
Additional context
Add any other context about the problem here.