Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

traceo-sdk-browser. Browser cancels XMLHttpRequest.send(...) on window.beforeunload event #10

Open
AlexeyBarsuk opened this issue Oct 11, 2024 · 0 comments

Comments

@AlexeyBarsuk
Copy link

AlexeyBarsuk commented Oct 11, 2024

When refreshing or leaving window the window.beforeunload event if fired. This leads Performance.batch object to call flush method, that calls XMLHttpRequest.send. As browser closes (or leaving) the window, this request is being cancelled.
In this situation Firefox throws error "Error: [Traceo SDK] Cannot send data to Traceo Platform. Make sure the application is running. Caused by: TypeError: NetworkError when attempting to fetch resource." that is being caught by traceo and sent to traceo server.
Google Chrome just silently cancels request with no errors emitted.

Снимок экрана 2024-10-12 в 00 53 15

@AlexeyBarsuk AlexeyBarsuk changed the title Browser cancels XMLHttpRequest.send(...) on window.beforeunload event traceo-sdk-browser. Browser cancels XMLHttpRequest.send(...) on window.beforeunload event Oct 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant