Skip to content

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

@AlexeyBarsuk

Description

@AlexeyBarsuk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions