vaadin / flow

Vaadin Flow is a Java framework binding Vaadin web components to Java. This is part of Vaadin 10+.
Apache License 2.0
618 stars 167 forks source link

Route changes are not consistently detected when redeploying through Spring Boot Devtools #18794

Closed Legioth closed 8 months ago

Legioth commented 8 months ago

Description of the bug

There's something weird going on with updating the route registry when redeploying through Spring Boot Devtools. For some classes, the route registry is updated only after a full server restart whereas a Devtools redeploy is enough for other classes.

Expected behavior

All view changes should be detected with a regular redeploy.

Minimal reproducible example

  1. Download skeleton-starter-flow-spring-24 from the quick download button on start.vaadin.com
  2. Launch using mvn or by running the main method
  3. Add Test.java with the following content
    @Route
    public class Test extends VerticalLayout {
    public Test() {
        add(new Text("Test"));
    }
    }
  4. Notice that the server is redeployed but that navigating to /test gives an error page
  5. Restart the server. Notice that you can now navigate to /test.
  6. Comment out @Route in Test.java. Wait for the redeploy and notice that /test still renders the view.
  7. Restore the @Route annotation in Test.java and comment out @Route in MainView.java. Wait for the redeploy and notice that you cannot navigate to /.
  8. Restore the annotation in MainView.java, wait for the redeploy and notice that you can again navigate to /.

Versions

sxp267 commented 8 months ago

Yes, I'm also facing same issue. This used to work but after some changes it is not. Force restart works again image

Legioth commented 8 months ago

Seems like some part of this issue isn't deterministic since I had a similar issue when demoing the feature yesterday even if it had worked nicely five times before when doing (more or less) exactly the same thing while preparing the demo.