-
-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve recovery after reconnecting #1762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodja I just tested the implementation with a simple test app:
from nicegui import ui
ui.input('Hello world!')
ui.button('Click me!', on_click=lambda: ui.notify('Button clicked!'))
ui.run(reconnect_timeout=10.0)
When I type something into the input field, disconnect the connection via developer tools > network > throttling, wait for the connection popup and reconnect, the input is preserved. But the same happens for reconnect_timeout = 0
. Shouldn't this trigger a reload?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my bad: reconnect_timeout
has no effect on the auto-index client. 🤦🏻♂️
@rodja I just got aware of a possibly inconvenient behavior when using @ui.page('/test')
async def page(client: Client):
ui.label('Hello, world!')
await client.disconnected()
print('disconnected', flush=True) The |
@falkoschindler yes, that's why I chose to use 0 for 1.3. But allowing clients to reconnect without page reload is super important and I would gladly trade the delayed |
This pull request tries to implement #1761.