ApplicationInsights-JS
ApplicationInsights-JS copied to clipboard
Handle locally stored data that is too old to send anymore.
Data which was saved to local storage due to the user navigating away or closing the browser might end up being older than the current two day max age for sending by the time the page is loaded again. We could either drop old data ourselves or handle the 400 error code from the server.
Example 206 response with a 400 rejected item in the batch:
{"itemsReceived":2,"itemsAccepted":1,"errors":[{"index":1,"statusCode":400,"message":"103: Field 'time' on type 'Envelope' is older than the allowed min date. Expected: now - 172800000ms, Actual: now - 414962282ms"}]}
This is an issue with time, you can replace time to current data. This would resolve the issue.