vaadin / hilla

Build better business applications, faster. No more juggling REST endpoints or deciphering GraphQL queries. Hilla seamlessly connects Spring Boot and React to accelerate application development.
https://hilla.dev
Apache License 2.0
926 stars 57 forks source link

Flux connection is not properly resumed in some cases #2834

Closed Legioth closed 1 month ago

Legioth commented 1 month ago

Describe the bug

A Flux subscription is not resumed after disconnecting using the "Offline" preset in Chrome dev tools.

It seems like the underlying WebSocket is reopened but onSubscriptionLost is never called which in turn means that the subscription is never reopened. I did also observe similar symptoms in real-world scenarios with other browsers but there's no easy deterministic reproduction for those since Firefox keeps WebSocket connections open when enabling "offline" mode and Safari doesn't even have an offline emulation mode.

The @Push functionality in Flow does automatically handle a corresponding situation so we're probably just missing some Atmosphere event to listen to.

Expected-behavior

Expected that the subscription could be restarted after being offline.

Reproduction

System Info

Originally observed with Vaadin 24.5.0.beta4