Skip to content

saveInBackground/saveAsync not working with circular links #587

@batkov

Description

@batkov

Hello,

I've tried this on Parse iOS SDK 1.10.0 / 1.9.1 / 1.8.5 / 1.8.0
Also local storage enabled. I think this is the key issue.

If we have circular links object not being saved.
For example, we have following entities:

Message (text (string), like (Like))
Like (message (Message))

If we will try for existing Message create like, set links, so saveInBackground will stuck. No call to server performed.

- (void) setLikeToMessage:(Message) msg {
     Like * like = [Like object];
     like.message = msg;
     msg.like = like;
     [msg saveInBackgroundWithBlock:(BOOL, NSError*) {
            // Not called. Server call not performed
     }];
}

But this code will work:

- (void) setLikeToMessage:(Message) msg {
     Like * like = [Like object];
     like.message = msg;
     msg.like = like;
     [like saveInBackgroundWithBlock:(BOOL, NSError*) {
            // Called. Works properly
     }];
}

I did stop research on this issue, but then I found that I cannot sign up existing anonymous user.
I have following entities:

User (experience (Experience), personalProdile (PersonalProfile), ....another fields)
Experience (user (User), another fields)
PersonalProfile (user (User), another fields)

And for existing anonymous user Im' trying to do following:

+ (void)signUpWithUserName:(NSString *)userName 
password:(NSString *)password 
email:(NSString *)email
completion:(void(^)(NSError *error))completion {
    User *user = [User currentUser];
   // I did try to make [User objectWithoutDataWithObjectId:] but local data store get's data from DB.
    user.username = userName;
    user.password = password;
    user.email = email;

    [user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
        // Not called. Server call not performed
        if (completion) {
            completion(error);
        }
    }];
}

And it stuck for ever. I did debug and found that it goes to method called

+ (BFTask *)_deepSaveAsync:(id)object withCurrentUser:(PFUser *)currentUser sessionToken:(NSString *)sessionToken

And so BFTask created in this method never being called.

Please advise

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions