vaadin / portlet

Portlet support for Vaadin Flow
https://vaadin.com
Other
2 stars 3 forks source link

Portlet not responding after the first Heartbeat request #166

Closed mehdi-vaadin closed 4 years ago

mehdi-vaadin commented 4 years ago

After the first Heartbeat request is sent (by default 5 minutes after the portlet is loaded), the portlet doesn't respond anymore. For example, if a button on the portlet is clicked the loading indicator is shown and stayed there forever like the following.

vaadin-portlet-loading

To reproduce it, click on a button in the portlet after 5 minutes (heartbeatInterval) has passed since the portlet is loaded.

The following errors are shown in the browser console log:

Received message with server id 6 but expected 5. Postponing handling until the missing message(s) have been received
Gave up waiting for message 5 from the server

One other noticeable thing that seems to be the cause of this bug is that the heartbeat request has a JSON response which can be seen in the Network section of Chrome Developer Tools. While normally heartbeat requests don't have any response. The JSON response is like the following.

for(;;);[{"syncId":3,"clientId":2,"timings":[1631,1168]}]

In fact, the heartbeat request is not handled by HeartbeatHandler. It's handled by either PortletBootstrapHandler or PortletUidlRequestHandler because their canHandleRequest method returns true for a heartbeat request.

Versions: