Skip to content

fix: use correct fileurl in ignore/whitelisturl calls for captureMessage redirects #1304

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

Merged
merged 1 commit into from
Apr 17, 2018

Conversation

kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek requested a review from a team April 16, 2018 12:35
@kamilogorek kamilogorek changed the title fix: use correct call url in ignore/whitelisturl calls fix: use correct fileurl in ignore/whitelisturl calls for captureMessage redirects Apr 16, 2018
// if stack[1] is `Raven.captureException`, it means that someone passed a string to it and we redirected that call
// to be handled by `captureMessage`, thus `initialCall` is the 3rd one, not 2nd
// initialCall => captureException(string) => captureMessage(string)
if (initialCall && initialCall.func === 'Raven.captureException') {
Copy link
Contributor Author

@kamilogorek kamilogorek Apr 16, 2018

Choose a reason for hiding this comment

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

I'm not sure if we shouldn't use /captureException$/ here or not, as someone may use a different object's name when not using our singleton. But it sounds like a very odd edge-case.

Copy link
Contributor

Choose a reason for hiding this comment

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

meh, i think this is good unless some minification or babel transform on class or function names could break this string equality

Copy link
Contributor

@MaxBittker MaxBittker left a comment

Choose a reason for hiding this comment

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

nice find! 😂 and reasonable fix.

i'm concerned that people are occasionally confused by the behavior of raven from the console (mostly that foo.doesn'tExist() doesn't hit sentry) but that's a problem for another day.

// if stack[1] is `Raven.captureException`, it means that someone passed a string to it and we redirected that call
// to be handled by `captureMessage`, thus `initialCall` is the 3rd one, not 2nd
// initialCall => captureException(string) => captureMessage(string)
if (initialCall && initialCall.func === 'Raven.captureException') {
Copy link
Contributor

Choose a reason for hiding this comment

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

meh, i think this is good unless some minification or babel transform on class or function names could break this string equality

@kamilogorek
Copy link
Contributor Author

Yeah, I myself had no clue that errors triggered in console are not caught by onerror handlers :<

@kamilogorek kamilogorek merged commit d3d6f98 into master Apr 17, 2018
@kamilogorek kamilogorek deleted the capturemessage-url-filter branch April 17, 2018 09:20
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.

2 participants