JDK-8311097 : Synchron XMLHttpRequest not receiving data
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: jfx17.0.6,jfx20
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2023-06-29
  • Updated: 2023-11-01
  • Resolved: 2023-09-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 Other
8u401Fixed jfx17.0.9Fixed
Related Reports
Relates :  
Description
Since an updated Webkit, synchron XMLHttpRequests do not receive the full data.
Debugging shows, that the call to "twkDidReceiveData" in
com.sun.webkit.network.URLLoader receives a buffer with the full length of received data. However the Network-dataReceived entry from the WebView-Debugger only shows 1 byte of data.

Attached is a sample gradle project, that uses undertow to demonstrate this.
This opens a WebViews, that has two links with onClick-handlers for XMLHttpRequests.
In both cases a line with "["N","J","20.0.0.111","_","1030924534.5084621120561509448.7657568095387879952.0.0",3,"469033f83c8474486a45259c78f58a10"]" should be written to System.out.

On "Sync" only "[" is written.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jfx17u/pull/146 Date: 2023-09-02 12:47:18 +0000
02-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jfx21u/pull/12 Date: 2023-09-01 11:47:09 +0000
01-09-2023

Approved to backport to jfx21u for 21.0.1.
01-09-2023

Fix request for jfx21u: I would like to backport this change to jfx21u, because the problem is applicable to all jfx versions with webkit above v614.1. The change applies cleanly. The risk seems to be low: we just correct the data accumulation for synchronous requests. Supplied test demonstrates that the change works as expected.
01-09-2023

Changeset: 82f27748 Author: Andrew Brygin <bae@openjdk.org> Committer: Dmitry Cherepanov <dcherepanov@openjdk.org> Date: 2023-09-01 09:31:20 +0000 URL: https://git.openjdk.org/jfx/commit/82f2774895b41ce81215012556483b1519495d5d
01-09-2023

[~bae] Once you integrate this fix into the mainline, can you also backport it to jfx21u? If you want to make the request, I'll approve it. See [1] for instructions. [1] https://mail.openjdk.org/pipermail/openjfx-dev/2023-August/042200.html
31-08-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1227 Date: 2023-08-30 14:32:37 +0000
30-08-2023

I missed, that the resource loading for the start page in the sample didn't work in build jars. When running in eclipse it did fine. I've updated the sample.
11-07-2023

[~oschmidtmer] I tried importing the project using IntelliJ IDE. While executing, I see below error: UT005071: Undertow request failed HttpServerExchange{ GET /} Could you let me know if there are any additional dependencies?
10-07-2023

1. XMLHttpRequest.zip contains a gradle project, please import it to your IDE 2. Run the class "Start.java". This starts a small HTTP server bound to 127.0.0.1 and opens a JavaFX WebView, where "alert" is send to System.out and a simple page is opened: There are two links, "Sync" and "Async" which start either synchron or asynchron requests and show the response in an "alert". 3. Try both: "sync" only writes "[" to System.out via the "alert". "async" a much longer String. Both should have the same ouput. When opened in a external browser, the sample page is found as "http://localhost/", the prepared response for the XMLHttpRequest under "http://localhost/xhr" .
05-07-2023

[~oschmidtmer] Could you please detailed steps to reproduce the issue?
05-07-2023