TrilonIO / angular-application-insights

Angular & Azure Application Insights module - Find out performance and usage of your app by connecting Microsoft Azure Application insights with your Angular application by @TrilonIO
https://www.trilon.io
MIT License
135 stars 39 forks source link

Telemetry not cached during network disconnects #19

Open ctenden opened 7 years ago

ctenden commented 7 years ago

Tracking of telemetry appears to be lost if TRACK POST is performed while network is down.

Reproduction Steps: With Network On Perform a trackEvent Wait for TRACK POST Perform a trackEvent Turn off Network Wait for TRACK POST Turn on network Perform a trackEvent Wait for TRACK POST

In Insights, only trackEvent 1 and 3 are captured.

Is it possible to use navigator.online to decide whether or not to perform TRACK POST?

MarkPieszak commented 7 years ago

Would it be easier to do this on the app-side? Are you talking about storing things in an Collection if it's offline and sending the event when it comes back on?

ctenden commented 7 years ago

Correct. Telemetry collected before a disconnect and during a disconnect IF the attempt is made to TRACK, is lost. Telemetry collected during a disconnect but reconnects before the TRACK is fine.

GustavoAmerico commented 6 years ago

@ctenden This behavior is caused in the original implementation, I found the file responsible for the http request, but I will not be able to implement and test it in the next days. Try opening an Issue in the repository: https://github.com/Microsoft/ApplicationInsights-JS/blob/master/JavaScript/JavaScriptSDK/Sender.ts