Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

isSourceMinified is wrong #42

Open
ghost opened this issue Feb 9, 2016 · 3 comments
Open

isSourceMinified is wrong #42

ghost opened this issue Feb 9, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Feb 9, 2016

The method returns "true" on non-minified files. The reason for that is when source files have long lines (longer then 250 char limit set).

I know 250 chars is a lot, but still, can this setting be available to set via the configuration?

I'm using angular-opbeat.js.

@hmdhk
Copy link
Contributor

hmdhk commented Feb 9, 2016

Hi @juliusosokinas ,

Thanks for reporting the issue. Can you tell me about your specific situation (maybe some sample code).
Our algorithm for minified source detection is not deterministic (it can't be!) but it should work in most cases.

Cheers,
Hamid

@ghost
Copy link
Author

ghost commented Feb 9, 2016

Hi Hamid,

I have been testing our app to work with angular-opbeat. For some reason, when using our original code, the stacktrace frame was not containing pre and post context. So I was investigating what might be wrong.

When looking at your code, I found out that isSourceMinified() was returning "true". Obviously, that was not actually true, because I knew the source file is only concatinated but not uglyfied.

Then I found out that this little guy here https://github.com/opbeat/opbeat-js/blob/master/src/exceptions/context.js#L151 was causing the problem.

In my code there was a line longer than 250 chars. Increasing the set limit https://github.com/opbeat/opbeat-js/blob/master/src/exceptions/context.js#L125 solved the problem.

Obviously, I later made that the line in my original code shorter, but in general it was lying about file being minified. I know some developers don't really care about how long their lines are, so this should be probably made as a setting set to default to 250. Also, it would be good to add this to documentation for future references.

@hmdhk
Copy link
Contributor

hmdhk commented Feb 9, 2016

Thanks for your extensive reply @juliusosokinas ,
You're right about the documentation, we will sort it out soon.
About the setting, it's more likely that we provide a way to manually specify which files are not minified. I will take a note of this for future enhancements.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant