flow: Grid fails to update with new data after initial page load
Description of the bug
On the initial page load, a Vaadin application running under Tomcat displays an empty Grid and starts a background task to do an initial load of the data. In the demonstration project, this background task takes one second.
After th one second delay, the data is available and the DataProvider signals refreshAll(). The Grid updates on the server but does not send any update to the client. So from the client perspective, it appears as if the load is taking forever. The user is staring at an empty table indefinitely. But really there is just a missed update somehow.
Once some other unrelated event triggers the server to send an update to the browser, then the client properly synchronizes and the problem resolves itself. But this could take an arbitrarily long time.
Expected behavior
The client display should update immediately when the Grid receives new data on the server. There is a missing update.
Minimal reproducible example
https://github.com/archiecobbs/vaadin-grid-load-fail-issue
Note this demo shows the status of the load operation via a spinner/progress widget. The spinner widget should spin for exactly one second after the page loads. By watching the log in the console you can see that after the initial page load it only spins for one second on the server, but on the client it spins indefinitely.
Here is the Firefox error log. There are a bunch of errors, some probably unrelated from other tabs.
'http://localhost:8080/': Load failed with status 404 for script 'http://localhost:8080/sw.js'.
Note in this example the page load occurred at time 16:56:16 but the grid didn’t update on the browser until 16:56:49.
Versions
- Vaadin / Flow version: 24.4.12
- Java version: 17
- OS version: Mac OS 14.6.1
- Browser version: Firefox 130.0.1
- Application Server: Tomcat 10.1.28
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 31 (25 by maintainers)
I can confirm that the issue with specifically ComponentRenderer is a regression introduced by https://github.com/vaadin/flow-components/pull/4148. I’ve created a separate issue for this and added it to the backlog.
This is probably obvious already, but while you guys are looking at this it’s probably worth reviewing the other examples quoted in this earlier comment in case they suffer from the same problem. Thanks.