Skip to content

Async request breaks Vaadin 14 MPR UI #86

@caalador

Description

@caalador

Copy from issue made by @TobseF

Problem

We are migrating our monolithic business app with the MPR to Vaadin 14.4.8. But in the current state our app is very unstable and often breaks with a "frozen UI". The page loads all content, but it never stops showing the loading indicator and shows a JS Error message.

⚠ JS Client Error

$0.firstElementChild.setResponse is not a function

2021-05-20_12h42_17

After that exception, the waring Gave up waiting for message seems to indicate, that the client-server communication is broken.

⚠ JS Client Warning

com.vaadin.addons.widgetsets.AddonWidgetset-0.js:10797 
Thu May 20 12:51:09 GMT+200 2021 com.vaadin.client.communication.MessageHandler
WARNING: Gave up waiting for message 1 from the server

It seems, that it happens when an async UI Runnable (getUI().access(...)) get's executed before the initial framework request is finished. Then the client is not ready to service this request. Push in enabled by the @Push annoation.

Here you can see the Request order in such a case in recorded Browser session:
2021-05-20_12h54_52

This behavior is new with the MPR and happens when the UI is loaded. We can reproduce it several times with a Selenium Test. It happens in 2 of 4 runs. It happen even every time if we set throttle the browser in debug settings to network Fast-3G.

Expected Behavior

No matter when we call ui.access(...) the client should only get updates, after it's loaded and ready to serve push requests. Push updates should never destroy the client ui in such a way, that loading-indicator and user page interaction breaks.

Versions:

  • Vaadin 14 version: 14.4.8
  • Vaadin 8 version: 8.12.3
  • Vaadin Flow Plugin version: 2.4.6
  • Browser version: Chrome 90.0.4430.212
  • Java version: 14.0.2
  • Push: enabled by @Push-annotation
  • Server running with vaadin.productionMode = false

⚡Full stacktrace

client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1017 Exception is thrown during JavaScript execution. Stacktrace will be dumped separately.
cu @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1017
bu @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:973
_t @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:583
Hr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:497
es @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
AB @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:942
Jr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1022
$r @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
qk @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:428
Br @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1023
Cr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1003
Bp @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
(anonymous) @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:993
sb @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:436
vb @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:888
(anonymous) @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:623
_f @ vaadinPush.js?v=2.4.6:2765
_invokeFunction @ vaadinPush.js?v=2.4.6:2754
_invokeCallback @ vaadinPush.js?v=2.4.6:2884
_websocket.onmessage @ vaadinPush.js?v=2.4.6:1457
client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:212 (TypeError) : $0.firstElementChild.setResponse is not a function
ZC @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:212
Xn @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1005
Wn @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:771
Yn @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:598
cu @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1017
bu @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:973
_t @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:583
Hr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:497
es @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
AB @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:942
Jr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1022
$r @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
qk @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:428
Br @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1023
Cr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1003
Bp @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
(anonymous) @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:993
sb @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:436
vb @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:888
(anonymous) @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:623
_f @ vaadinPush.js?v=2.4.6:2765
_invokeFunction @ vaadinPush.js?v=2.4.6:2754
_invokeCallback @ vaadinPush.js?v=2.4.6:2884
_websocket.onmessage @ vaadinPush.js?v=2.4.6:1457
client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:199 The error has occurred in the JS code: '$0, $1, $0.firstElementChild.setResponse($1)'
_C @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:199
cu @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1017
bu @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:973
_t @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:583
Hr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:497
es @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
AB @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:942
Jr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1022
$r @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
qk @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:428
Br @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1023
Cr @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1003
Bp @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:1027
(anonymous) @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:993
sb @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:436
vb @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:888
(anonymous) @ client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:623
_f @ vaadinPush.js?v=2.4.6:2765
_invokeFunction @ vaadinPush.js?v=2.4.6:2754
_invokeCallback @ vaadinPush.js?v=2.4.6:2884
_websocket.onmessage @ vaadinPush.js?v=2.4.6:1457
client-5C40CA4B9D1F93A241DF9189632E0919.cache.js:200  Processing time was 5ms

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions