analytics.js-integrations
analytics.js-integrations copied to clipboard
Added statusCode check for NetworkErrors in Segmentio integration
What does this PR do?
Changes Segment.io integration to retry events when there is a NetworkError from the browser.
Are there breaking changes in this PR? No
Testing
Added test case.
Any background context you want to provide?
Noticed this the other day when debugging issues in the browser (IE, turning off WiFi, or telling the tab to go into offline mode)
Is there parity with the server-side/android/iOS integration components (if applicable)? I dont believe so
Does this require a new integration setting? If so, please explain how the new setting works No
Links to helpful docs and other external resources https://fetch.spec.whatwg.org/#concept-network-error Which is referenced from https://xhr.spec.whatwg.org/#response
A network error is a response whose status is always 0, status message is always the empty byte sequence, header list is always empty, and body is always null.