Skip to content

Vendor+IE8-ify json-stringify-safe, fix handler with XDomainRequest #883

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 7 commits into from
Mar 20, 2017

Conversation

LewisJEllis
Copy link
Contributor

@LewisJEllis LewisJEllis commented Mar 9, 2017

This should fully address #881. There were two symptoms each with a separate root issue:

  • Object doesn't support this property or method when sending messages/exceptions
    • json-stringify-safe was using Array.prototype.indexOf
    • Resolved by vendoring json-stringify-safe in and eliminating use of Array.prototype.indexOf
  • success/error events were not firing in IE8/IE9
    • An XDR request object doesn't have a status attribute which we were expecting/relying on, and XDR.onload only fires in success cases (error cases use onerror).
    • Resolved by separating req state handlers to XHR and XDR cases in _makeRequest

I pieced this into several separate commits to make it easy to see our modifications relative to the vendored originals.

/cc @benvinegar

@LewisJEllis LewisJEllis requested a review from benvinegar March 9, 2017 22:14
Copy link
Contributor

@benvinegar benvinegar left a comment

Choose a reason for hiding this comment

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

Looks fine, I just want to poke at this w/ BrowserStack first.

}
if (opts.onError) {
request.onerror = function () {
var err = new Error('Sentry error code: XDomainRequest');
Copy link
Contributor

Choose a reason for hiding this comment

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

I quickly experimented w/ having a helper onerror function that could be called from either the XDomainRequest handler or onreadystatechange, but it quickly ended up taking up more code so nm ...

Copy link
Contributor

@benvinegar benvinegar left a comment

Choose a reason for hiding this comment

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

Sorry this took so long to review.

Verified w/ IE8 via Browserstack.

@benvinegar benvinegar merged commit 4979fa5 into master Mar 20, 2017
@benvinegar benvinegar deleted the vendor-stringify-safe branch March 20, 2017 05:42
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