-
Notifications
You must be signed in to change notification settings - Fork 25
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
Logs are lost while request is pending. #95
Comments
Are you suggesting that logs are only dropped given the above plus |
Our use-case is that our app is generating sequentially two errors in a such interval that second is fired at the time first one is still pending. As I mentioned in the original comment, using the |
What is your |
Default. |
If |
The thing is that "app shutting down" is not that reliable. You might lose the logs if the browser crashes due to a null pointer exception, which is when things like |
I was on PTO but now considering options, will reply soon. |
I've been thinking about your last message for a few days now but I'm still a bit unsure about how I would implement |
I guess if it provides different storage options (memory, localStoarge etc.) would solve the problem. By default is memory and when the app crashes it will lost the pending logs however, it depends how important these logs are. If critical, then relatively speaking, the logs could be synced up from a persistent local storage when the app launches again. |
Just wanted to stop by and say that this just bit me hard, and that this is an absolute show-stopper. This library cannot be trusted to actually send the logs that make it into the I cannot stress enough how broken this library is in it's current state. In order to be a little more helpful, I wrote a small repro case: https://gist.github.com/jamesottaway/8865eb7aa8808efb9af9316e02fe8cac As for a constructive suggestion, please just lean into promises and let the consumer manage them. Two changes I'd suggest are:
|
this.sendLogs()
method has a flaw that the assurance of data being successfully sent to the given endpoint is depending on combination of:This particular flag -
this.logSending
is being reset within thethis._postSuccess()
method which is only being executed when the http promise is being resolved.Which means that all logs which will be sent during the pending request time, will be dropped and forever lost here:
if (this.logSending || this.pendingLogs.length === 0) { return false; }
This should work and no logs must be silently dropped without an interval/batch/flushLogs involvement.
The text was updated successfully, but these errors were encountered: