Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vaadin 24.4.12 @Push and iOS18 Problem #20010

Open
janarbis opened this issue Sep 20, 2024 · 1 comment
Open

Vaadin 24.4.12 @Push and iOS18 Problem #20010

janarbis opened this issue Sep 20, 2024 · 1 comment

Comments

@janarbis
Copy link

janarbis commented Sep 20, 2024

Description of the bug

Since the new iOS18 Update on iPhone we get the following Warning when using push():
WARN com.vaadin.flow.server.communication.ServerRpcHandler -- Resynchronizing UI by client's request. A network message was lost before reaching the client and the client is reloading the full UI state. This typically happens because of a bad network connection with packet loss or because of some part of the network infrastructure (load balancer, proxy) terminating a push (websocket or long-polling) connection. If you are using push with a proxy, make sure the push timeout is set to be smaller than the proxy connection timeout
wich leads into a white screen. The App needs to be refreshed after that.

In my dev machine I only use tomcat 10, no vpn, no loadbalancer or similar. The Connection is stable as well.
The problem only occures if i use the ssl connector of the tomcat. With HTTP their is no problem, but this is not the solution.

Expected behavior

No Warning

Minimal reproducible example

We use the @Push annotation at our main route. The problem occures if we want to update the UI from an backround task with
UI.getCurrent().access(() -> { UI.getCurrent().push() });

Versions

  • Vaadin / Flow version: 24.4.12
  • Java version: 17
  • OS version: iOS18 (iPhone)
  • Browser version: Safari
  • Application Server: Tomcat 10
  • IDE: Eclipse
@janarbis
Copy link
Author

janarbis commented Oct 5, 2024

Maybe this small example helps you to investigate the problem:

@Viewport("width=device-width, initial-scale=1, maximum-scale=1")
@Push(PushMode.MANUAL) 
public class PushTestAppShellConfigurator implements AppShellConfigurator {
}
@Route("")
public class PushTestView extends Div {

	private VerticalLayout vl;

	public PushTestView() {
		vl = new VerticalLayout();
		NativeButton button = new NativeButton("Add labels via push",
				event -> addLabel());
//				event -> new Thread(this::addLabel).start());
		add(button, vl);
	}

	private void addLabel() {
		long threadId = Thread.currentThread().getId();
//		getUI().ifPresent(ui -> ui.access(() -> {
		UI.getCurrent().access(() -> {
			
			vl.removeAll();
			for (int i = 0; i < 10; i++) {
				vl.add(new NativeLabel("Label " + i + " added via push by thread " + threadId));
//				ui.push();
				UI.getCurrent().push();
			}
		});
//		}));
//		Thread.currentThread().interrupt();
	}
}

If you press the Button on iPhone (iOs18) multiple times the problem will occures.
I also get the following error when putting the app in background:

11:49:04.887 [https-openssl-nio-8443-exec-7] DEBUG org.atmosphere.container.JSR356Endpoint -- Problem in web socket session
java.net.SocketException: Connection reset
	at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:394)
	at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:426)
	at org.apache.tomcat.util.net.SecureNioChannel.read(SecureNioChannel.java:601)
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1294)
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1247)
	at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1191)
	at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:74)
	at org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:184)
	at org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:164)
	at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:152)
	at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:60)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:57)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:833)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔎 Investigation
Development

No branches or pull requests

2 participants