Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Set xhr override before creating AppInsights client #199

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

devm33
Copy link
Contributor

@devm33 devm33 commented Feb 20, 2024

If not supplied to the constructor the delegate AppInsightsCore class does not pick up the default channel (BreezeChannelIdentifier = "AppInsightsChannelPlugin") plugin configuration and therefore doesn't use the supplied XHR override.

This is subtle to notice when running in Node 18+ (VS Code 1.82+) since the AppInsights SDK mostly uses the fetch API which is available in Node and appears to work.

This is similar to the pattern used for the 1DS client which presumably doesn't have the same issue and is where I got the idea to try it. Except the 1DS SDK separates the constructor from an initialize method:

appInsightsCore.initialize(coreConfig, []);

If not supplied to the constructor the delegate AppInsightsCore class
does not pick up the default channel (`BreezeChannelIdentifier =
"AppInsightsChannelPlugin"`) plugin configuration and therefore doesn't
use the supplied XHR override.

This is subtle to notice when running in Node 18+ (VS Code 1.82+) since
the AppInsights SDK mostly uses the `fetch` API which is available in
Node and appears to work.
Copy link
Member

@lramos15 lramos15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, I don't utilize the App insights path much compared to 1DS

@VSCodeTriageBot VSCodeTriageBot added this to the February 2024 milestone Feb 21, 2024
@lramos15 lramos15 merged commit 997abf0 into microsoft:main Feb 21, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants