faro-web-sdk icon indicating copy to clipboard operation
faro-web-sdk copied to clipboard

`window.faro.pause()` does not `update faro.config.paused`

Open alioshr opened this issue 2 years ago • 0 comments

When pausing / unpausing a faro instance using the global object, despite of using the default window.faro, or passing a globalObjectKey, does not update the value found in config.paused on the global object.

Example:

If I run: window.faro.pause() then inspect the global instance: window.faro.config.paused, the value is still the default: false

Steps to reproduce

  1. Initialize faro:

import { initializeFaro, getWebInstrumentations, ReactIntegration, ReactRouterVersion, Faro, } from '@grafana/faro-react'; import { TracingInstrumentation } from '@grafana/faro-web-tracing'; import { Route, useHistory } from 'react-router-dom';

// .....

const faro = initializeFaro({ url: 'some-url', apiKey: 'some-api-key', instrumentations: [ ...getWebInstrumentations({ captureConsole: true, }), new TracingInstrumentation({ resourceAttributes: { 'service.name': 'some-service-name', 'team.name': 'some-team-name', }, }), new ReactIntegration({ router: { version: ReactRouterVersion.V5, dependencies: { history: useHistory, Route, }, }, }), ], session: (window as any).PRELOADED_STATE?.faro?.session, app: { name: 'some-app-name', version: 'some-app-version', environment: undefined, }, user: { username: 'some-username', }, });

  1. Pause the instance: `window.faro.pause()``

  2. Check if the value changes in the global instance: window.faro.config.paused

Expected behavior

window.faro.config.paused should be updated upon pausing / unpausing the instance.

Actual behavior

I cannot infer if an instance is paused.

Environment

SDK version: 1.0.5 SDK instrumentations: React Device type: desktop Device name: MacBook Air M1 13" **OS:**MacOS **Browser:**Chrome

alioshr avatar Jun 05 '23 19:06 alioshr