analytics-react-native icon indicating copy to clipboard operation
analytics-react-native copied to clipboard

Events fired before app is killed never send – even after re-opening

Open ary31415 opened this issue 2 years ago • 7 comments

  • analytics-react-native version: ^2.13.4
  • Integrations versions (if used):
  • React Native version: 0.71.7
  • iOS or Android or both? iOS

Steps to reproduce Open app, fire some arbitrary analytics events, then kill app before flushAt or flushInterval for segment client is reached. Reopen app.

Expected behavior Backlogged analytics events should be persisted and sent to server as soon as app is reopened – or failing that, along with the next batch of events generated in the new session.

Actual behavior Events from the new session are created and sent as expected, events from the first session are simply lost.

ary31415 avatar May 18 '23 23:05 ary31415

+1

jinsung-kim avatar May 19 '23 20:05 jinsung-kim

It is possible this was caused by this import issue that got fixed in Sovran 1.0.3.

Can you upgrade sovran? Make sure to install also @react-native-async-storage/async-storage or use your own persistor.

oscb avatar May 22 '23 23:05 oscb

I updated Sovran and this mostly alleviated the issue.

When I kill the app and then reopen it, events are not sent immediately, seeming to be in slight conflict with the README? The doc says "By default, the analytics will be sent ... whenever the app resumes if the user has closed the app with some events unsent.", which is the behavior I observe when I put the app in background and then later resume it – the backlogged events are sent immediately. By contrast, when I kill it and re-open it, there is no immediate batch of events sent.

However, when I do receive a batch of events once the flushInterval is reached, the events from the previous app session are included among them, which is good.

ary31415 avatar Jun 01 '23 19:06 ary31415

We are also facing the same issue and even after updating to Sovran 1.0.4, it doesn't seem to alleviate the issue at all. All the events before app kill are lost completely.

viraj-nikam avatar Jun 14 '23 16:06 viraj-nikam

Just wanted to see if there are any updates on this one, we think it may be related to see data issues we've seen since upgrading from 1.x to 2.15.0.

liamfd-titan avatar Sep 19 '23 20:09 liamfd-titan

Same issue here - 2.16.0

ddemid avatar Oct 05 '23 13:10 ddemid

Hello, bumping this issue as we are also experiencing this in our application. Manually flushing the event cache after critical events were fired helped alleviate, but I'm hoping for a less manual solution.

dane-thomas-vs avatar Dec 04 '23 15:12 dane-thomas-vs

Hi folks- it is my understanding that this was resolved in this PR #916 please let me know if that is not the case or if you are still experiencing any issues and we can go from there. Thanks!

alanjcharles avatar Jul 30 '24 14:07 alanjcharles