Open xionglingfeng opened 1 year ago
Well, that does seem strange....
Basically enableAutoRouteTracking
really just hooks the history
API for replaceState
and pushState
which when either of those events occur, on completion it sends it's own "internal" events named "replaceState", "locationchange" "pushState" with any defined "namePrefix" (from config) prefixed to the event name. (https://github.com/microsoft/ApplicationInsights-JS/blob/2847561dc627728bd20879b23ad212b5158c30d2/extensions/applicationinsights-analytics-js/src/JavaScriptSDK/AnalyticsPlugin.ts#L715-L821)
And on receipt of this "internal" event it will trigger a PageView event to get queued
So this "should" not be interfering with any other components.... unless
namePrefix
)I'm struggling to think of any other reasons.
So the workaround for your scenario would be to specify a namePrefix
to the configuration, this will also change the session cookie name and any local storage used, so any previous existing cookies / session storage will no longer get referenced.
Also note we have not released an ApplicationInsights v3.x compatible version of the angularplugin yet! And as such this combination has not been tested, which means that the AI v3 changes to support dynamic configuration may not completly work as expected as the angularplugin is not listening to any changes. There are also some changes around exported properties and some assumptions around the config object that have changed between AI v3 and v3. So it (might) work ok and it might not, I don't think this issue is related to the version mismatch (I'd expect TS compile errors and exceptions to be thrown if something is not working correct)
This Issue will be closed in 30 days. Please remove the "Stale" label or comment to avoid closure with no action.
Description/Screenshot Before enabling
enableAutoRouteTracking
,_oidcSecurityService.authorize()
will not send any AJAX request and directly redirect browser to the/authorize
endpoint. Once enabledenableAutoRouteTracking
,_oidcSecurityService.authorize()
starts to send AJAX requests to/.well-known/*
.Steps to Reproduce
applicationinsights-web
as:angular-auth-oidc-client
as:Call
_oidcSecurityService.authorize()
Firefox 111
)"@microsoft/applicationinsights-web": "3.0.0"
,"@microsoft/applicationinsights-angularplugin-js": "^3.0.2"
Expected behavior Calling
_oidcSecurityService.authorize()
will not send any AJAX request. It directly redirect the browser to the configured/authorize
endpoint.Additional context Add any other context about the problem here.