flow
flow copied to clipboard
Browser window is opened again on redeploy after a while
Description of the bug
Seems like the new logic with a timeout to avoid re-opening the browser window for each server start is also triggered for redeploys and not only when the server is newly started.
Expected behavior
Expected that the browser opening logic is triggered only when starting the dev server but not when only redeploying an already running server.
Minimal reproducible example
- Get a Spring Boot application with Vaadin 24.4 from start.vaadin.com
- Start the app, observe that a browser window is opened.
- Make a code change, observe that the app is redeployed but no browser window is opened.
- Leave the application open for a while (30 min iirc)
- Make a code change, observe that a new browser window is opened when the application redeploys.
Versions
- Vaadin / Flow version: Vaadin 24.4.0.beta5
This is a known problem as we can't know why the server is running the code or if there is a browser tab open.
The timeout was decided for being ok enough for normal development cycle and can be extended/shortened as needed.
I think you miss the point. The previous implementation only did things when the server was started but not for redeploys. The new implementation also does things for redeploys (after the timeout). It shouldn't do anything for redeploys regardless of the timeout.
It should work the same as before and return the system property value if time has run out since file creation. The only thing added was the don't check system property if file created before timeout https://github.com/vaadin/flow/blob/b23c0b76972efab61ad03149ac936e25df0c0476/vaadin-dev-server/src/main/java/com/vaadin/base/devserver/BrowserLauncher.java#L74
Need to be investigated.
The logic seems solid. Maybe I was actually restarting the server without realizing it? Will try to remember to leave it running over lunch again and see if it reproduces.
Can't reproduce now. Must have been a fluke.
Happened again now and this time I'm certain I didn't restart the server. But I also don't have any additional clues on what goes on here.