@PreserveOnRefresh not working

I have annotated my ui class with @PreserveOnRefresh and override the refresh method. But on refreshing the page with browser the method is not getting called. I am using navigation to navigate through the whole application.

When i refresh it is giving me request not registered by handler
17155087.png

I just tested it with one of my test apps, and in my case refresh(…) is being called correctly. So you must have something else in your application that interferes this.

If you can create simplified test application that replicates your problem, that could reveal more information. And if the problem can be replicated, it is should be reported in our GitHub issue tracker https://github.com/vaadin/framework/issues.

In my case there is only one ui class. And i am navigating to different views in that with navigator. When user clicks refresh he should stay on the same view but it gives the above error. I think this is because the navigator also get initialized again on clicking refresh,so the navigator no longer contains that view.

Does the refresh method is called everytime the refresh button is clicked??

What Vaadin version are you using? Looks like you might be using Vaadin 8 with @PushStateNavigation. There has been some problems with that e.g.: https://github.com/vaadin/framework/issues/10633. So an upgrade to the latest version might help. A bug report would also be much appreciented if you can pinpoint the problem.

The refresh-method is called every time the refresh button is clicked or the user triggers a refresh in some other way (e.g. typing the same url in the addresss bar)

-Pontus