MarkAsDirty() when browser tab not active

Hi all,

I’m working on an event mechanism in our application. I’m currently testing the following scenario, using Chrome.

A user is logged in and has opened the same View in two browser tabs. He adds an Item to a Grid component (which is using a persistence-backed container) in one browser tab. This triggers an event being fired to the container instance of the other (inactive) browser tab. This container updates its item ids and calls the fireItemSetChange() method.

Debugging what happens next, it results in an RpcDataProviderExtension calling markAsDirty() (in AbstractClientConnector) which in turn calls getConnectorTracker().markAsDirty(this) on the UI instance.

However, despite these methods being called, this does not refresh the Grid in the browser tab that was not active. Navigating between views will refresh the Grid, though there is no logic to trigger a refresh when entering the view.

What can cause this? Could the browser suspend all Javascript if a browser tab is not active, or does Vaadin contain logic for this?

Thanks for any help!

I’ve also tested when a colleague logs in on my server and opens the view. When I add an Item on my machine, the container corresponding to his View instance (in an active browser tab) receives an event, all relevant methods are called including markAsDirty(), but his View does not update.

When selecting an item in the Grid, it does trigger a refresh (even though the Grid is set to immediate). It’s not really a problem but I do wonder why it works this way.