matomo-org / matomo-sdk-android

SDK for Android to measure your apps with Matomo. Works on Android phones, tablets, Fire TV sticks, and more!
BSD 3-Clause "New" or "Revised" License
394 stars 164 forks source link

[Question] How to Determine Dispatch Success When Manually Dispatching Events? #515

Open arihav opened 5 months ago

arihav commented 5 months ago

I need to manually dispatch events due to certain constraints, which I have implemented by setting the DispatchInterval to -1 and tracker.dispatchBlocking(). I am currently dispatching events using a job service.

My question is: how can I determine if a dispatch attempt has failed in order to implement a retry mechanism?

Thank you for your assistance!

hannesa2 commented 4 months ago

Hi, do you have an idea, how to force this error ? Best by a test

arihav commented 4 months ago

Thank you for your response. I apologize, but I didn't fully understand what you meant. My question is: when using the manual dispatch mechanism, how can I determine if the dispatch failed, similar to how it is handled in the default dispatcher?

I appreciate your help!

hannesa2 commented 4 months ago

how can I determine if the dispatch failed

I search a way to force a failed dispatch, to have a reproduceable workflow for development

arihav commented 4 months ago

I am reproducing the error by setting the tracker.dispatchTimeout to 1, so the request to the server always fails within this short time.