I'm seeing some Websocket problems on 3.4.2 on Linux. File changes trigger compilation OK. On browser I get the spinner about a change, but it gets stuck.
On log I occasionally see
Exception in thread "" java.lang.AbstractMethodError: Receiver class shadow.http.server.CoreAsyncWebSocketHandler does not define or inherit an implementation of the resolved method 'abstract void onPing(byte[])' of interface shadow.http.server.WebSocketHandler.
at shadow.http.server.WebSocketExchange.process(WebSocketExchange.java:71)
at shadow.http.server.SocketConnection.run(SocketConnection.java:71)
at java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314)
at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)
Or
[:front] Build completed. (3730 files, 2 compiled, 0 warnings, 0.46s)
Exception in thread "" java.net.SocketException: Socket closed
at java.base/sun.nio.ch.NioSocketImpl.endWrite(NioSocketImpl.java:379)
at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:422)
at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440)
at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:819)
at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1195)
at shadow.http.server.WebSocketExchange.sendFrame(WebSocketExchange.java:211)
at shadow.http.server.WebSocketExchange.sendTextInternal(WebSocketExchange.java:173)
at shadow.http.server.WebSocketExchange.sendText(WebSocketExchange.java:150)
at shadow.http.server.CoreAsyncWebSocketHandler$fn__20077$fn__20078.invoke(server.clj:36)
at shadow.http.server.CoreAsyncWebSocketHandler$fn__20077.invoke(server.clj:34)
at clojure.lang.AFn.run(AFn.java:22)
at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)I'll try checking deps tree if our project has something that might affect this
fixed in 3.4.3
just a method implementation I missed
curious which browser? chrome on macos doesn't seem to send websocket ping frames?
Firefox @ Linux
good to know. should be fine now.
Testing. I did also see we have older versions of a few deps in the classpath (commons-io, ring-core, ring-codec).
No errors on the log, spinner shows on the browser after a change but gets stuck and WS reconnects after a moment. I solved the conflicting transitive deps, so those should be OK.
(No errors on the terminal.) This is on browser console
Same on Chrome for me.
don't think there are any transitive deps that could affect this
Yeah, just wanted to remove that variable to be sure
something on the server side log?
[:front] Build completed. (3728 files, 2 compiled, 0 warnings, 0.44s) Exception in thread "" java.net.SocketException: Connection reset by peer at java.base/sun.nio.ch.SocketDispatcher.write0(Native Method) at java.base/sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:62) at java.base/sun.nio.ch.NioSocketImpl.tryWrite(NioSocketImpl.java:394) at java.base/sun.nio.ch.NioSocketImpl.implWrite(NioSocketImpl.java:410) at java.base/sun.nio.ch.NioSocketImpl.write(NioSocketImpl.java:440) at java.base/sun.nio.ch.NioSocketImpl$2.write(NioSocketImpl.java:819) at java.base/java.net.Socket$SocketOutputStream.write(Socket.java:1195) at shadow.http.server.WebSocketExchange.sendFrame(WebSocketExchange.java:211) at shadow.http.server.WebSocketExchange.sendTextInternal(WebSocketExchange.java:173) at shadow.http.server.WebSocketExchange.sendText(WebSocketExchange.java:150) at shadow.http.server.CoreAsyncWebSocketHandler$fn__20077$fn__20078.invoke(server.clj:36) at shadow.http.server.CoreAsyncWebSocketHandler$fn__20077.invoke(server.clj:34) at clojure.lang.AFn.run(AFn.java:22) at java.base/java.lang.VirtualThread.run(VirtualThread.java:329)
Exception in thread "" java.lang.AbstractMethodError: Receiver class shadow.http.server.CoreAsyncWebSocketHandler does not define or inherit an implementation of the resolved method 'abstract void onPing(byte[])' of interface shadow.http.server.WebSocketHandler.
should be goneStill seeing this one ocassionally
That message doesn't appear right after change -> reconnect or anything, but sometime later
> Close Code 1006 is a special code that means the connection was closed abnormally (locally) by the browser implementation.
I suspect that it might have to do with websocket text frame sizing
might try to send a large frame might be broken up somehow. checking if I can reproduce this somehow.
If I remember correctly, the compiled JS code is sent over WS to the browser, so it would make sense that in this project the message is quite large
can you give com.thheller/shadow-http {:mvn/version "0.1.4"} a shot? just manually adding it as a dep and trying again? don't need to make a new shadow-cljs release if it doesn't work.
Yep, works now:
cljs-build-complete message is 1.4MB
@thheller Thanks for the super fast fix again 🙂
thanks for testing. shadow-cljs 3.4.4 is the proper update then. better remove the fixed shadow-http dep so you don't miss updates there.
Piggybacking on here. We noticed hot reloading stopped working when we went from 3.3.6 to 3.4.2 (filed https://github.com/thheller/shadow-cljs/issues/1259 just now). A websocket issue sounds like a plausible culprit to this. I'll test with 3.4.4 when I find the time. Right now I need to move our org back to 3.3.6 so folks are unblocked 😄