snowplow / snowplow-actionscript3-tracker

Snowplow event tracker for ActionScript 3.0. Add analytics to your Flash Player 9+, Flash Lite 4 and AIR games, apps and widgets
http://snowplowanalytics.com
4 stars 1 forks source link

Add retry from Flash storage for unsent requests #44

Open nakulgan opened 7 years ago

nakulgan commented 7 years ago

Currently, Requests that fail are added to an array. But are then lost.

  1. Push unsent requests to localstorage to save them between sessions
  2. Retry later on a successful request for a new event.

See discussion here.

@alexanderdean @jbeemster thoughts?

alexanderdean commented 7 years ago

SGTM - @jbeemster ?

jbeemster commented 7 years ago

@nakulgan sounds good!

The general flow for the mobile trackers is as follows:

  1. An event is sent to the Tracker
  2. This event has any extra contexts it needs attached to it
  3. The event is loaded into persistent storage
  4. Another thread picks these events from storage and begins sending them
    • Either listening for changes or polling for new events
  5. On success the event is removed from persistent storage

One caveat on the above is the case of events that are too big. This generally means events above 50000 bytes in size - we handle these cases by still sending the event but we do not care about the return code and always remove them from persistent storage.

You can see some of this process explained in this blog post: http://snowplowanalytics.com/blog/2015/10/08/snowplow-unity-tracker-0.1.0-released/#features

nakulgan commented 7 years ago

Thanks @jbeemster Josh. Implementing the above flow pretty much covers this ticket and #4 as well.

nakulgan commented 7 years ago

I would move this to 0.5.0, #4 and #44 together make testing quite complex. I would prefer to add a mocking library Mockolate first to have proper tests.

@alexanderdean thoughts?

alexanderdean commented 7 years ago

Hey @nakulgan - I think this was one of the things our customer was really looking for, so I don't think we can push back. But we can certainly add whatever additional testing scaffolding you see fit as additional tickets in this release...

alexanderdean commented 7 years ago

Please update commit title!