DataDog / browser-sdk

Datadog Browser SDK
Apache License 2.0
291 stars 130 forks source link

🐛 rum requests pending forever #2982

Closed renanrodrigueszup closed 1 week ago

renanrodrigueszup commented 1 week ago

Describe the bug Not sure if this is a bug or a misconfiguration, but I'm facing the following scenario: Some of the RUM requests are never ending and stay stuck with status pending as shown in the picture below. I believe this causes XHR requests to be put on a browser's request Queue (because of browsers tcp connection limits), which ends up giving the users a feeling of dealing with an slow performance application.

image

To Reproduce Steps to reproduce the behavior:

setup the configuration as follows:

 datadogRum.init({
      applicationId,
      clientToken,
      site: '***.com',
      service,
      env,
      trackViewsManually: true,
      sessionSampleRate: 100,
      sessionReplaySampleRate: 10,
      trackUserInteractions: true,
      trackResources: true,
      trackLongTasks: true,
      defaultPrivacyLevel: 'mask-user-input',
    })

Expected behavior Requests should never stays pending forever. A timeout should be defined for these cases.

BenoitZugmeyer commented 1 week ago

This is a display bug in the Chrome devtools. The request is actually never started. You can reproduce this by trying to call fetch with keepalive: true and a body greater than the 64k limit (on any webpage):

fetch('/', { method: 'post', keepalive: true, body: new Uint8Array(70_000) })