Failed to load response data

Recently, the testing team raised an issue - Web requests showing Failed to load response data.

Thus began the analysis and resolution process, marked here for reference.

Exclusions

  1. response.status is 200, indicating that the request was initiated and returned successfully.
  2. The response body of this request is empty. However, Chrome typically displays This request has no response data available for empty response bodies, which is not the case here. Hence, this is not the problem.

Root Cause

After eliminating the above possibilities, it was determined that the issue must be due to a browser-side code problem. Investigation revealed that a page refresh immediately followed the problematic request. This led to the conclusion: ====> “The immediate refresh caused the response not to load in time.”

Reproducing the Issue

For example, the issue can be perfectly reproduced if an asynchronous request with no response body is sent, and the page refreshes immediately after the response. However, if a deliberate delay of 2 seconds is introduced, the message changes to This request has no response data available. At this point, the issue was completely understood.

Further Discussion

Canceled

Typically, we discuss request statuses in the context of successful handshakes and returned states. However, other scenarios exist, such as the one above, and the canceled status. The canceled status generally occurs when a JS script manually interrupts a request or when the page refreshes while a request is still in progress.

At the end

While searching for resources on this issue, no mention of such a scenario was found online. Hence, this record is made in hopes of helping others.

References