Closed TesteurManiak closed 1 year ago
@TesteurManiak thanks for getting to this so fast!
Just for anyone else who sees this in the future. I believe this lib ticks on _dequeueInterval
which is currently set to 10 seconds - which means Matomo will receive requests every 10 seconds if there is anything that is queued up to be sent to Matomo.
This feature will now only remove those events from the queue if they have sent successfully, meaning that events will continue to fail whilst the app does not have internet (or can't reach Matomo), until it reconnects with Matomo and will send all events in a batch request.
@TesteurManiak please correct if any of that is incorrect.
@mattjbrent you are correct, the events that failed to be sent will stay in the queue until they're sent successfully (or until the app is closed)
This PR aims to fix #51, basically any request that didn't send successfully will stay in the queue and we only clear it afterwards.
I've also added improved a bit our current logging system and added some exceptions instead of just checking using assertions. (We should also consider at some point to add a
verbose
property to enable logging or not but that'll be for a future PR)