Network drops with Vaadin Flow

Hi,

I have seen that Vaadin Flow can handle shorter network drops and reconnect seamlessly. Can you provide more details on how Flow manages these network interruptions? Specifically, I’d like to understand the circumstances under which the user risks losing data during a network drop.

Thanks,
Anders

Are you asking because you’re trying to understand a case where data was lost in real life, or are you just trying to understand if data loss is a possibility?

Just trying to understand in which circumstances it can “resync” the data with the client since the server should have the state since the connection was lost. Sometimes I have to refresh the browser and then the data that was entered (in a form for example) up to the network failure was lost.

There’s no concept of a “form” in Vaadin as such. Field values are usually synchronized on blur or on select. If you have fields a, b, and c, and you have filled out a and b when the network disappears, values from a and b are already on the server. If you refresh the browser before the connection is re-established, you get a new UI with newly initialized fields.

1 Like

That’s also my understanding so theoretically I could loose the network a couple of minutes and once the connection is reestablished continue working without loosing the UI state/session.

It depends how you have build your application. I would guess that 80/90 percentage of application would loose the current state. Session should not be a problem.

In addition to reconnections, there may be cases when messages from client are lost, e.g. due to network glitch. In such cases, when Vaadin spots this, it makes server-client UI state re-sych that means that the current full UI state on the server is sent to the client and then the page get’s re-rendered. In such a scenario, the client could loose some user input data, if the glitch happens nearly the same time, when a user types in some data and client triggers a call to server containing this data.

Vaadin 24.7 will contain a better fault-tolerant mechanism by caching the messages and avoiding the re-sync. Read more here https://vaadin.com/docs/latest/flow/advanced/server-client-communication.

About the cases, when the reconnections happens because of network total drops, I agree with @ollit.1 , if it happens after user input has been sent to server, it should stay on the server and basically not lost after network connection recovery.

Thanks, that sounds like a good improvement coming up in Vaadin 24.7. :+1:

Anders