You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
'cancelled' http.client spans due to Xhr responses being falsely reported as requests #4427
http.client spans get marked as 'cancelled' due to Xhr responses being falsely reported as requests.
Setup:
Use vueRouterInstrumentation
Make some xhr requests before Vue routing happens (i.e. before 'pageload' transaction has even started).
Actual result:
If the responses (of the before-vue-routing requests) return after Vue routing, they are recognized as new spans.
Consequently, these spans never receive any further update and eventually get marked as 'cancelled'
Expected result:
The responses (of the before-vue-routing requests) get discarded?
Troubleshooting:
For every xhr request, xhrCallBack is called two times:
When the request is created, to start the http.client span
When the request is completed, to finish the http.client span
However, in the first call, Vue routing has not happened and hence instrumentation has not started the 'pageload' transaction yet. Thus, the execution is halted and the http.client span is not properly initialized. Then, in the second call, handlerData.xhr.__sentry_xhr_span_id__ is not available, so the xhr request completion is mistaken as a new request creation.
changed the title [-]'cancelled' http.client spans due to Xhr **responses** being mistakenly reported as **requests**[/-][+]'cancelled' http.client spans due to Xhr responses being mistakenly reported as requests[/+]on Jan 20, 2022
changed the title [-]'cancelled' http.client spans due to Xhr responses being mistakenly reported as requests[/-][+]'cancelled' http.client spans due to Xhr responses being falsely reported as requests[/+]on Jan 20, 2022
I wonder if it makes sense and is possible to somehow track the requests that happen before Vue routing? After all, the transaction is 'pageload' so I think it should track everything from the moment user opens the page, not just after Vue routing has started?
I just found out many events on my app were missed because my app failed to properly wait for Vue router.isReady.
There are probably still some valid use cases for sending requests before Vue router is fully initialized, but hopefully this comment is still helpful for others stumbling across this issue.
Activity
[-]'cancelled' http.client spans due to Xhr **responses** being mistakenly reported as **requests**[/-][+]'cancelled' http.client spans due to Xhr responses being mistakenly reported as requests[/+][-]'cancelled' http.client spans due to Xhr responses being mistakenly reported as requests[/-][+]'cancelled' http.client spans due to Xhr responses being falsely reported as requests[/+]datbth commentedon Jan 21, 2022
I wonder if it makes sense and is possible to somehow track the requests that happen before Vue routing? After all, the transaction is 'pageload' so I think it should track everything from the moment user opens the page, not just after Vue routing has started?
datbth commentedon Jan 24, 2022
I just found out many events on my app were missed because my app failed to properly wait for Vue
router.isReady.There are probably still some valid use cases for sending requests before Vue router is fully initialized, but hopefully this comment is still helpful for others stumbling across this issue.
AbhiPrasad commentedon Feb 18, 2022
#4531 will also help further address this, but if there's anything else that comes up, please let us know!