Unrecoverable sync error

I’m currently evaluating Vaadin (v24.2.4 with default Websocket transport) for a business critical application. Using Chrome tools I am subjecting the browser to various network conditions, such as bandwidth limits, simulated latency, temporarily going offline for a few seconds. Most times Vaadin sessions recover automatically, but not always.

Have included a stack trace associated with the unrecoverable error.

I would like to implement a “fail safe” way to detect and handle this scenario.

2023-12-08T16:07:11.665+08:00 INFO 678172 — [nio-8080-exec-2] c.v.f.s.communication.ServerRpcHandler : Ignoring old duplicate message from the client. Expected: 137, got: 136
2023-12-08T16:07:11.824+08:00 ERROR 678172 — [nio-8080-exec-4] c.v.flow.server.DefaultErrorHandler :

java.lang.UnsupportedOperationException: Unexpected message id from the client. Expected sync id: 137, got 138. more details logged on DEBUG level.
at com.vaadin.flow.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:313) ~[flow-server-24.2.4.jar:24.2.4]
at com.vaadin.flow.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:114) ~[flow-server-24.2.4.jar:24.2.4]
at com.vaadin.flow.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[flow-server-24.2.4.jar:24.2.4]
at com.vaadin.flow.server.VaadinService.handleRequest(VaadinService.java:1522) ~[flow-server-24.2.4.jar:24.2.4]
at com.vaadin.flow.server.VaadinServlet.service(VaadinServlet.java:398) ~[flow-server-24.2.4.jar:24.2.4]
at com.vaadin.flow.spring.SpringServlet.service(SpringServlet.java:106) ~[vaadin-spring-24.2.4.jar:na]
at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) ~[tomcat-embed-core-10.1.15.jar:6.0]

Is there a recommend to
(a) show a “disconnected” glass panel on the client upon re-sync after some delay, and suggest the client to refresh their browser?
(b) have the backend notified of the hard failure and initiate a hard reset of a Vaadin session to effectively recover?

The Vaadin debug monitor does detect an error, but the browser just continues to show a stale view state.

Here’s a related ticket: java.lang.UnsupportedOperationException: Unexpected message id from the client · Issue #16664 · vaadin/flow · GitHub

Many thanks @vital-koala - as the root cause is proving elusive it would be great to prioritise the ability to intercept this condition so that the client and backend can reset and recover.

JFYI my setup is comparatively simpler, and occurred while running on Windows local host using Chrome browse tools and switching connection throttle profile to “offline” and then back to “none”.

Do post your findings in the ticket