this.sendLogs() method has a flaw that the assurance of data being successfully sent to the given endpoint is depending on combination of:
- Particular internet connection.
- sendLogs() execution timing from the client.
This particular flag - this.logSending is being reset within the this._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.
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.logSendingis 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.