I am facing an issue where the workflow in the following code gets stuck at the saveInBackground
method. It does not return any response from the server, not even an error message, even after waiting for a long time.
Note : I am currently using self hosted parse server like below
“Parse Dashboard”
Here is the code snippet:
public void createGroup(
String groupName,
String groupDescription,
ParseFile parseFile,
ParseUser admin,
List<ParseUser> members,
GroupCallback callback
) {
Group group = new Group();
group.setGroupName(groupName);
group.setGroupDescription(groupDescription);
group.setAdmin(admin);
group.setGroupPicture(parseFile);
group.setCreatedDate(new java.util.Date());
// First save the group
group.saveInBackground(e -> {
if (e == null) {
// Group saved successfully, now add members
ParseRelation<ParseUser> memberRelation = group.getMembers();
for (ParseUser member : members) {
memberRelation.add(member);
}
// Save group again with members
group.saveInBackground(secondSaveError -> {
if (secondSaveError == null) {
// Group and members saved successfully
callback.onComplete(null, group);
} else {
// Error in saving members
callback.onComplete(secondSaveError, null);
}
});
} else {
// Pass the error back in the callback
callback.onComplete(e, null);
}
});
}
The issue occurs inconsistently and seems to hang indefinitely at the saveInBackground
step. I am not receiving any error messages or responses from the Parse server in such cases.
What could be causing this behavior, and how can I debug or resolve it?