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

reconnection callback is called twice #2841

Closed cromoteca closed 1 month ago

cromoteca commented 1 month ago

Describe the bug

https://github.com/vaadin/hilla/pull/2782 introduced a new connection state management, but onReconnect will inadvertently run the user-defined reconnect callback to get its return type. The same callback is already called from onReopen.

Expected-behavior

No response

Reproduction

Look at https://github.com/vaadin/hilla/commit/9bafcb7a5c15810c522d085321dbdacf3b2f971f#diff-a041bf6ab4a2971d34fa718ca88626d7100fa4ffec35a9260bf65669deeb0a59R230

System Info

24.6.0.alpha1