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
"Invalid JSON from server" even when Push response contains Vaadin-Refresh #14753
Comments
It might help pinning down the issue if you could also provide information (e.g. request URL and parameters) to identify what type of request this is so that we can understand which part of Vaadin it is that doesn't properly handle the response it receives. |
I had a similar problem and I managed to fix it by using a space after the URL to redirect e.g.
instead of
|
@Legioth The screenshot is from the user, but I think I found the root cause: I think we enabled Push recently too (or it became the default now?) - at least I see the browser making push requests / having a websocket connection open. Handling of
While there is only a comment "Should likely do the same as xhrInvalidContent" in the method for push requests: I see this in the code for invalid push responses:
Note the different error text: since the error in the screenshot starts with "Invalid JSON from server" and not "Invalid JSON response from server", this means that it's indeed a Vaadin Push request. I'll edit the issue title. |
As you can see in the screenshot, there is no URL (and there is a space). I tried the regex from the code and it matches this content. But it appears to be a Push response and the regex check is not done in that case. |
The push hypothesis makes sense. Thanks for clarifying! |
You can try with
|
Fixes #14753 # Conflicts: # flow-client/src/main/java/com/vaadin/client/communication/DefaultConnectionStateHandler.java
This ticket/PR has been released with Vaadin 23.1.13. |
This ticket/PR has been released with Vaadin 23.2.6. |
This ticket/PR has been released with Vaadin 14.9.0.beta1 and is also targeting the upcoming stable 14.9.0 version. |
Description of the bug
Our Vaadin 22 application is fronted by an SSO solution. When the session has timed out, the login page is returned as HTML when Vaadin performs a request and expects JSON. That login page contains the string
Vaadin-Refresh
.In the past this caused Vaadin to refresh the page, but now the following error is shown:
As you can see, the string
Vaadin-Refresh
is still present. But we did upgrade from Vaadin 14 to Vaadin 22 and from Spring Boot 1.5.x to 2.5.x not so long ago.Expected behavior
No error should be shown and the page should be refreshed instead.
Minimal reproducible example
I don't know of any other way to reproduce this than to add a reverse proxy in front of a Vaadin application and make it return an HTML page containing
Vaadin-Refresh
at some point when Vaadin makes an internal request.Versions
The text was updated successfully, but these errors were encountered: