parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 735 forks source link

Update appVersion using task queue #1057

Open tigranl opened 4 years ago

tigranl commented 4 years ago

Is your feature request related to a problem? Please describe. I want to be able to update appVersion with each app update. Also, it can be a configurable option. appVersion is not updated due to a chance of DDoSing your own server #24

Describe the solution you'd like I suggest to use a task queue, to reduce a load from updating appVersion directly by calling Installation class. This, of course, means also updating other SDKs.

dplewis commented 4 years ago

@mtrezza It looks like you looked into this issue, any feedback?. https://github.com/parse-community/Parse-SDK-Android/issues/976

mtrezza commented 4 years ago

Thanks for suggesting this enhancement.

To quickly review, the issue seems to be that a change of the app version is not detected by the SDK and updated for the installation object in the Parse Server DB.

The current workaround is to make the current installation dirty by changing any other field of the installation. Upon saving the installation, the installation version is compared with the actual app version and updated if necessary, so that it is updated on the server. This has indeed room for improvement.

https://github.com/parse-community/Parse-SDK-Android/blob/797786ff42223094c20d2dadd7af9e616020175a/parse/src/main/java/com/parse/ParseInstallation.java#L113-L121

Historically, an auto-update of the app version was not implemented in the SDK:

We do this to prevent your app from DDOSing yourself when releasing app updates, since app updates and new app runs occur around the same time for all users and it would cause a spike that may lead you to run over your req/s limit.

I don't understand the argument, because the update process on Android (and iOS) does not launch the app. A manual app launch by the user causes many requests, and the installation update would just be 1 more request. So this 1 more request occurs in expected app traffic patterns and thus the infrastructure is already prepared and scaled accordingly.

*One example of how these mass installation updates could occur are apps that are woken up by the OS due to significant location changes or push notifications. The app is woken up which means the SDK is launched and the update is pushed to the server while the app is in the background. Maybe there are other examples?

mtrezza commented 4 years ago

Since this an issue with the Parse Android SDK, I am transferring this to the appropriate repository.