-
Notifications
You must be signed in to change notification settings - Fork 237
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
[BUG] Failed XHR request after ever tracked item when gathered logs exceed maxBatchSizeInBytes while offline #2034
Comments
I've just checked the code and the "offline" detection is only used to stop retries, it appears that any event will always be batched for sending and the issue your hitting here is because the To add support for full offline detection and the dropping of "old" batch events is not a small task. Tagging this as an enhancement. Not sure of the timeframe for scheduling something like this as the SDK is primarily designed as an Online SDK.... But this is not the first ask for this. |
Would there be any disadvantage to adding an offline check before the forced send? I'm happy to raise a PR for this... it seems like a fairly safe fix, that eliminates the unnecessary call failure? |
That is one of the locations to put the check, but once we do that we start to violate the In terms of PR's yes, we are happy to take them. Just be aware that we are about to release the |
Yeah... the Which branch should I raise a PR against for adding the single check? We're still on the 2.X series internally, so I have a mild preference to getting the fix in that series if possible... completely understand however if that's not an option! |
Go for The current plan is to do this most likely by the end of this week (PST) and maybe even tomorrow. We are only release v3.x to NPM to start with. |
Sounds like a plan! I'll raise something shortly, and am happy to address other aspects if you'd prefer it to be part of the PR. I'm conscious though that sometimes that's slower than just doing the work yourself though, so happy to work however suits you best here 😄 |
Just logging a workaround that's helped here: I've just increased that |
Apart from releasing the ApplicationInsights v3.x and handling any required hotfixes we still have quite a lot of work booked in April / May to complete the process which includes
So at the moment I'm pretty sure we are not going to get this this before at least the middle of the year (as there is not the complete list). So it's the perfect time for you to jump in, I'll apologize now if I become tardy in responding to any PR's |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description/Screenshot
I'm using ApplicationInsights-JS from within a cordova-based application, which often operates offline for reasonable periods of time.
I've discovered that when the collected offline logs exceed the configured
maxBatchSizeInBytes
(default is ~10kb), the sender starts trying to post records via XHR after every new log item added. This isn't really expected behaviour, as theSender
knows it's currently offline, and should be using the backoff policies.Steps to Reproduce
maxBatchSizeInBytes
)Expected behavior
When offline, no immediate send batches should be attempted, as they can't possibly succeed.
I suspect a check for the offline state should be added here: https://github.com/microsoft/ApplicationInsights-JS/blob/master/channels/applicationinsights-channel-js/src/Sender.ts#L372
The text was updated successfully, but these errors were encountered: