commons-app / apps-android-commons

The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons
https://commons-app.github.io/
Apache License 2.0
1.03k stars 1.24k forks source link

Event logging service for commons #734

Open maskaravivek opened 7 years ago

maskaravivek commented 7 years ago

Right now the EventLog class simply ignores the event if the Async Task fails. It should be handled properly so that events from the app are not missed. Ideally, all the logs should be first queued into a local table and then periodically synced.

It can be a potential task for the IEG renewal(#694)

misaochan commented 7 years ago

Sounds like a good plan - added it to the IEG renewal draft.

misaochan commented 7 years ago

@maskaravivek How long do you estimate this task will take? If a long time, do you think perhaps we could schedule it for the 2018 round with WMCZ instead? I'm having a tough time finalizing the renewal draft - it looks like we might have to take 1 or 2 things out due to potential time constraints.

maskaravivek commented 7 years ago

We can deprioritize it if we have time constraints. The way I am thinking about it might take at least a week of effort.

misaochan commented 7 years ago

Okay, thanks, will omit it from this round then.

Bluesir9 commented 7 years ago

Would like to take this up if its not being actively worked upon.

misaochan commented 7 years ago

Please feel free @Bluesir9 . :)

Bluesir9 commented 7 years ago

So based on my understanding, events should be first written to a local storage and from there we should attempt to upload them. Once successfully uploaded they can be removed from the local storage. The local storage here would ideally be a SQLite DB.

maskaravivek commented 7 years ago

@Bluesir9 Yes you are right. This could be one possible flow: Any event occurs > Put it in the local SQLite DB

Sync event > Schedule batch syncing of events(lets say batch of 50 events) every 5 minutes. Ideally just one batch should be synced every 5 minutes, rest of the events can wait for the next sync.