-
-
Notifications
You must be signed in to change notification settings - Fork 735
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
Making any call to 'ParseUser.saveInBackground()' on the UI Thread freezes app #993
Comments
I believe |
@Jawnnypoo thanks for the suggestion as well as taking the time to comment and help. I’ll give this a shot this evening and let you know how I go and what a tried. |
@Jawnnypoo so I've mucked around with this and it hasn't resolved the issue. I did
I still end up with the same results. After some testing, the |
Did you try |
I had a lot of similar issues saving objects with the Android SDK. |
@ramiro-ciocca you may be onto something with that, alot of my objects are complex with pointers to different objects. This shouldn't have to be worked-around on the server side though. This is a critical bug that should be looked into immediately if this is truly the case. |
@bstillitano, could you check if you see a loop of "garbage collecting" in the logcat when your app hangs? |
I forgot something very important. All the issues with save disappear if you disable th local data store. |
@ramiro-ciocca I've changed my init call so that it does not enable the LDS and it would appear that this does fix the issue. I am fine to keep using this workaround as I don't pin any data in my app and don't mind assuming that my users will always have an internet connection but this is a massive issue for devs relying on LDS for offline data storage. It means that they will need to integrate yet another SDK like realm in order to have any offline functionality. |
Yes, so we are 100% sure that it is a LDS related issue, and I have verified that the issue is in a recursive method inside save methods from ParseObject class, that recursivelly traverse through all the pinned objects before saving, looking for dirty properties. It is very inefficient since it takes minutes to traverse all the structure, depending on your structure of course, but it is enough to have some pointers to hang all the app. |
I can confirm that the traversal is also happening on my end. I think a cascade type value should be defaulted to false. If I am calling save on an object, I don't necessarily expect that it will save the children of that object. |
I'm still having problems when saving complex objects, can anyone implemente "cascadeSave=false" like parameter for save, please? |
I have noticed that no matter what, even on a fresh app install, if you call `ParseUser.getCurrentUser().saveInBackground()' on a UI Thread the app will hang. The example I used was calling the function after updating a user value after toggling a Switch component:
I've written a basic custom activity to prove my hypothesis. Starting an Activity of this type will cause the app to hang and leave a blank screen as can be seen by simulator screenshot attached. Activity is as follows:
After Running
If commenting out the saveInBackground() function
The text was updated successfully, but these errors were encountered: