Skip to content

Wrap upload requests for tracing in a runOutsideAngular block #3085

@scic

Description

@scic

Package + Version

  • [x ] @sentry/angular

Version:

5.27.6

Description

The Ajax Request to upload tracing information to Sentry are not done in a runOutsideAngular block. This leads to

  1. an unneeded ChangeDetection cycle which could hurt performance
  2. it adds to a delay of 1 seconds (defaultTimeout of tracing) to our E2E Protractor Setup that uses waitForAngular detection (checks to see there are open requests in angular)

Since no interaction with Angular on the result of this request is needed it can be run as if Angular was not there. This can happen in a runOutsideAngular block:

this.ngZone.runOutsideAngular(() => {
      setTimeout(() => {
        // update component data
        // but don't trigger change detection.
      });
    });

from https://angular.io/guide/zone

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions