Skip to content

Commit

Permalink
Bump stacktrace js modules (#354)
Browse files Browse the repository at this point in the history
* test: Add a failing test for known stacktrace parsing bug

URL paths with "@" in them incorrectly parse in Firefox/Safari due to a bug in the
error-stack-parser module

* fix: Upgrade to latest stacktracejs modules

error-stack-parser contains a bugfix for the test in the previous commit
stack-generator published
a long-term dangling PR which we were depending on in a fork, so this just switches back to the main
package

* chore: Rebuild

* test: Remove unnecessary assertion which is different for different browsers

* test: Generalise assertion to cater for variation across browsers
  • Loading branch information
bengourley authored Jun 4, 2018
1 parent e258e78 commit dd5ce9a
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 18 deletions.
14 changes: 6 additions & 8 deletions dist/bugsnag.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bugsnag.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/bugsnag.min.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions features/fixtures/unhandled/script/@dist/g.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
throw new Error('at in filename')
24 changes: 24 additions & 0 deletions features/fixtures/unhandled/script/g.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<script src="/node_modules/bugsnag-js/dist/bugsnag.min.js"></script>
<script type="text/javascript">
var ENDPOINT = decodeURIComponent(window.location.search.match(/ENDPOINT=(.+)/)[1])
var bugsnagClient = bugsnag({
apiKey: 'ABC',
endpoint: ENDPOINT
})
</script>
</head>
<body>
<pre id="bugsnag-test-should-run">YES</pre>
<pre id="bugsnag-test-state">PENDING</pre>
<script src="@dist/g.js"></script>
<script>
setTimeout(function () {
var el = document.getElementById('bugsnag-test-state')
el.textContent = el.innerText = 'DONE'
}, 5000)
</script>
</body>
</html>
13 changes: 13 additions & 0 deletions features/unhandled_errors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ Scenario Outline: detecting unhandled promise rejections with bluebird
| type |
| script |

Scenario Outline: parsing stacks correctly with "@" in filename
When I navigate to the URL "/unhandled/<type>/g.html"
And the test should run in this browser
And I let the test page run for up to 10 seconds
And I wait for 5 seconds
Then I should receive 1 request
And the request is a valid browser payload for the error reporting API
And the exception "message" ends with "at in filename"
And the "file" of stack frame 0 ends with "unhandled/script/@dist/g.js"
Examples:
| type |
| script |

# Scenario Outline: thrown error with malformed stacktrace
# When I navigate to the URL "/unhandled/<type>/a.html"
# Examples:
Expand Down
13 changes: 7 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@
"@bugsnag/cuid": "^3.0.0",
"@bugsnag/safe-json-stringify": "^2.1.0",
"browserify-versionify": "^1.0.6",
"error-stack-parser": "^2.0.1",
"error-stack-parser": "^2.0.2",
"iserror": "0.0.2",
"stack-generator": "github:bengourley/stack-generator#190a6f500cfc4a9ef77db204b4f571964e39c3d8"
"stack-generator": "^2.0.3"
}
}

0 comments on commit dd5ce9a

Please sign in to comment.