-
Notifications
You must be signed in to change notification settings - Fork 240
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
[BUG] AppInsights stub methods captured incorrect method names in the closure #1283
Comments
chenxinyanc
changed the title
[BUG] AppInsights stub methods fails to capture method name in the closure
[BUG] AppInsights stub methods captured incorrect method names in the closure
Jun 5, 2020
NICE CATCH! - the issue is on line 234 as you identified where it's using effectively the last popped name! |
Reopening for release tracking |
This was referenced Jun 15, 2020
Release is now fully deployed |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description/Screenshot
ApplicationInsights-JS/AISKU/snippet/snippet.js
Lines 225 to 240 in 5cb9e44
Note the statement on L227:
Since
var
spans the variable scope to the containing function (i.e._createMethods
), the value of this variable gets replaced among each iteration of the while loops.This causes all the
appInsights.[method]
calls beforeai.2.js
has loaded incorrectly forwarded asappInsights.trackEvent
calls.Steps to Reproduce
Copy-paste all the code in
snippet.js
, or its minimized version on README.md. Then follows the code. Ensure the following code is executed beforeai.2.js
has been downloaded.When running the code, you will find there are 2
trackEvent
calls to the actual appInsights object, making 2 extra (invalid) event traces.Expected behavior
I should have telemetry initializer set up. And there should be
trackPageView
called so I should have its telemetry.Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: