DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
19.45k stars 748 forks source link

Hot reload disconnect loops when SSR takes more than 1sec #2044

Closed ochrons closed 4 months ago

ochrons commented 4 months ago

Problem

When rendering SSR page after recompilation, and having the web page open trying to reconnect the web socket, if the rendering takes 1sec or longer, the connect/disconnect goes into a loop for a long time.

Steps To Reproduce

Make a server function call with use_server_future that takes more than 1 second to complete. When hot reload tries to reconnect over web socket, it times out before the rendering gets done, and tries to reconnect.

Even doing forced refresh in the browser doesn't break the loop.

This doesn't happen if the call takes less than 1sec.

Expected behavior

Should reconnect normally.

Screenshots image

Environment:

Questionnaire

This could be fixed by introducing some backoff in the reconnect delay.

ealmloff commented 4 months ago

This looks like the same issue as https://github.com/DioxusLabs/dioxus/issues/2032. You can follow that issue for more updates. We shouldn't be running server functions on any routes that do not return HTML