Skip to content

Saving object with block has no callback, fails to save. #763

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

Closed
GabrielMSharp opened this issue Jan 14, 2016 · 8 comments
Closed

Saving object with block has no callback, fails to save. #763

GabrielMSharp opened this issue Jan 14, 2016 · 8 comments

Comments

@GabrielMSharp
Copy link

Using both subclassing and localdatastore occasionally:

SPUserParseModel *user = [SPUserParseModel currentUser];
user.firstname = someString;
[user saveInBackgroundWithBlock:^(BOOL succeeded, NSError * _Nullable error) {
    //Nothing is returned
    if(!error && succeeded) {
     //Nothing is returned   
    }
];

Returns nothing, the error or succeeded bool never return. There's no debug info to look at, I've tried setting:

    [Parse setLogLevel:PFLogLevelDebug];

But still don't know how to investigate this.

I feel like there might be a Localdatastore issue, perhaps it saves locally and then corrupts somehow? But as I haven't used saveEventually and haven't explicitly changed pins, it seems odd.

Sometimes force-quitting and re-opening the app will fix the issue, but not for long.

@GabrielMSharp
Copy link
Author

Saving now giving new errors referenced #766

@nlutsenko
Copy link
Contributor

This seems very odd, and something might be blocking the save in this case.
It would be super helpful if you could attach a full stack trace to this issue (pause in debugger and use bt all) after you call saveInBackground... and it doesn't invoke a call back after a while.

@parse-github-bot
Copy link

Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.

Please try the latest SDK. Our release notes have details about what issues were fixed in each release.

In addition, you might find the following resources helpful:

@GabrielMSharp
Copy link
Author

I've fixed this by removing 'circular' pointers, where Class A has a pointer to Class B, just as Class B has a pointer to Class A. Removing these pointers and restructuring (requiring additional requests in most cases) code has consistently fixed the problem.

I'm afraid I fixed the issue before the chance to get my backtrace but now I know about it, next time I'll be sure to provide! (And debug myself hopefully!)

Issue #766 has also been fixed via this change.

@nlutsenko
Copy link
Contributor

Great, glad you found the solution.
If you encounter this once again - please open a new issue and include a backtrace.

@topwebtek7
Copy link

@GabrielMSharp
Could you please explain how to be fixed #766?
I'd like to know about it.

Looking for your message
Thanks,

@topwebtek7
Copy link

Here is my code to get error message.
currentUser = [PFUser currentUser]; [currentUser setValue:@"NO" forKey:PF_USER_ONLINE_STATUS]; [currentUser saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) { if (!error) { NSLog(@"Success!"); } else [ProgressHUD showError:error.localizedDescription Interaction:YES]; }];

@michaelbina
Copy link

I'm also still seeing the error referenced in #766: "Can't upload a file that doesn't exist locally." (code: 151)

This happens when I'm trying to upload to parse-server hosted on Heroku with a MongoLabs database. I've seen it when creating a new object in a class and uploading an image to one of the fields and also seen it when creating an object that has an image field that I'm not setting on creation. This seems to be a widespread issue when calling saveInBackgroundWithBlock on new objects.

The attached screenshot shows the call stack and error details.

screen shot 2016-02-18 at 10 09 26 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants