-
-
Notifications
You must be signed in to change notification settings - Fork 878
Flawed saveEventually architecture (does not execute saves in order) #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Currently, the order of save eventually commands is persisted on a per-object basis (every PFObject has an internal As much as I'd like to expand that to allow for atomic operations based on object graph, I don't think that's a feasible goal. There's no good algorithm we currently have that can detect if two objects are in a relationship with each other (see: If memory serves, point number 3 is actually not possible for a different reason - every operation you perform on an object creates an instance of FWIW, when the initial bug on Facebook developers came in (https://developers.facebook.com/bugs/667066373397539/), we did have a discussion on whether or not our back-end could be updated to support it, and we decided at that time there weren't enough people with that use-case to go ahead and attempt to support it right now. There are certainly architectural issues with LDS, and we have been having serious internal discussions on the best way to move forward and attempt to fix them, but seeing as backwards compatibility is a huge thing to have to maintain, some of these implementations may take a while to ever be seen. We have also discussed eventually depreciating |
Thanks for the explanation Richard. Would it be remotely feasible to consider having a global task queue instead of on a per-object basis? I'm obviously not an expert on this, but my sense is that this would solve a lot of issues. In theory it sacrifices a bit of performance because save requests aren't being parallelized that theoretically could be, but conceptually this feels to me like it greatly simplifies and reduces the risk of deadlocks, parent/child dirtying, etc. (Personally, I would advocate that far ahead of actually taking the object graph into account) |
@rdbayer A global task queue is certainly one option to consider. I'm not certain that it is the best route to go with right now, but I will bring it up with the rest of the team to get their thoughts. |
This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide |
I know this is more high-level than a bug report typically should be, but I am convinced that there is a fundamental flaw in how the saveEventually() mechanic works which cascades into a bunch of issues.
Root Cause(s)
Resultant Issues
Resultant Impact
I don't want to be melodramatic, but these issues have a catastrophic impact on our app. Places in our UI where we want users to be able to select multiple options in rapid succession can cause deadlock and/or missing data (i.e. does not get persisted to backend). Our only workaround right now is to show a Saving indicator as we sit there and wait for a saveInBackground() call to return, and this makes a terrible user experience, and severely discourages them from performing multiple actions in quick succession and has a big impact on our engagement and retention. We're an early startup at small scale now, but we very quickly need to scale up to a large number of users, and with these major issues we simply cannot keep realistically using Parse.
I know this is a thorny and difficult piece of code to diagnose/debug/re-architect, but the current way it's architected just does not work and to a large degree defeats the whole purpose of the saveEventually() architecture, which is to fire and forget and not wait for callbacks. Without this working, one cannot really build a responsive app that is acceptable in the modern app world if you have to constantly wait for background saves to finish before allowing the user to safely progress. Please prioritize this highly and give it the due attention it deserves!
The text was updated successfully, but these errors were encountered: