Skip to content

Making any call to 'ParseUser.saveInBackground()' on the UI Thread freezes app #993

Open
@bstillitano

Description

@bstillitano

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:

fun setAccountPrivacy(on: Boolean) {
    ParseUser.getCurrentUser().put("privateAccount", on)
    ParseUser.getCurrentUser().saveInBackground()
}

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:

import androidx.appcompat.app.AppCompatActivity
import com.parse.ParseUser

open class CustomActivity : AppCompatActivity() {
    override fun onResume() {
        super.onResume()

        //Save Parse User
        ParseUser.getCurrentUser().saveInBackground()
    }
}

After Running
Screenshot_1574686165

If commenting out the saveInBackground() function
Screenshot_1574686306

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions