My collegue found very interesting behaviour of shared state.
Example:
We use class Wrapper to wrap some other classes, and one of them contains simple data boolean, boolean, id (unique) - for example we named it TestClass
On server side we set TestClass with false, false, 1 - it fly to client, we store it to local storage, do stuff and in process we change flag to true. So the TestClass is true, false, 1… ok…
Next call to server… we get new TestClass: false, false, 2… but on client side stateChangeEvent give us this:
TestClass: true, false, 2
Any suggestions where we do problem or where is the problem?
We are not trying to update state from client to server… we only want to get new data, store them to local storage of browser and work with them…
But the problem is that on server side we put new correct data and vaadin fire this data to client… but on client side are incorrect at moment when stateChangeEvent is fired.
So my question is where is problem that server side is firing correct data, but client side is catching (or showing) incorrect data.
You wrote: "do stuff and in process we change flag to true. So the TestClass is true, false, 1… ok… "
So it sounds like you’re actually changing the class from the state on the client which might cause the problem you’re having.
Generally speaking it’s probably something in your code which is causing it and not Vaadin shared state so without a good idea on what you’re doing it’ll be difficult to find the cause.