Open tigranl opened 4 years ago
@mtrezza It looks like you looked into this issue, any feedback?. https://github.com/parse-community/Parse-SDK-Android/issues/976
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.
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.
a) Unless I missed something here*, I think the solution could be as easy as to auto-detect an app version change on app launch and auto-update the installation accordingly. There are also other system settings such as time zone, locale identifier, etc that would benefit from such an auto-detection because these suffer currently the same issue.
b) To be on the safe side, instead of auto-updating, we could just move the existing code that detects such changes earlier in the safe process, so when saving an installation that is not dirty, the auto-detection will make it dirty and eventually cause a save. This would be the preferred approach I think, because it gives the developer more control over when to update the installation.
c) Regarding the suggested "task queue" solution: If apps are somehow (likely to be) launched after an update, then I am not sure how one would conceptualize a distributed task queue across devices. If you meant to implement a task queue on Parse Server, that would not fully address the flood of installation update requests that would suddenly reach Parse Server. DDoS may not only affect Parse Server, but other network components in the chain that suddenly experience request spikes and cannot scale up quickly enough, so a task queue on Parse Sever would not suffice.
*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?
Since this an issue with the Parse Android SDK, I am transferring this to the appropriate repository.
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 #24Describe 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.