"java.lang.IllegalStateException: Call fetchIfNeeded()" when calling remove() on a already null field
I noticed another Error that doesn't happens on Parse.com hosted server when trying to call "remove" on a null text field I get this error:
"java.lang.IllegalStateException: ParseObject has no data for 'alternateEmail'. Call fetchIfNeeded() to get the data."
the android code that causes this is this:
super.remove("alternateEmail");
with the Parse hosted server I never get this error.
Can you please fix it?
Thanks!
The server shouldn't really affect this issue, and from looking at the android source, I don't see why this error could be thrown during a remove call. https://github.com/ParsePlatform/Parse-SDK-Android/blob/f439b3d3ba02eaad52e653b6890b3a10e74168da/Parse/src/main/java/com/parse/ParseObject.java#L157
How are you getting the object?
It's a reference from the CurrentUser object. And as I said it works well on the parse.com hosted server, so there shouldn't be a difference.
any update on this? I actually tried even calling fetchInBackground before calling "remove" but still the same error. trying to call "put" with a null value cases a different exception (as in parse.com hosted site) so that isn't an option either. Can you please check this?
??????
This sounds like an issue with the Android SDK. Can you open an issue over there?
How could it be an issue with android sdk? The server is the one throwin the exception. Also, this happens only on parse-server. Not on parse.com.
In that case can you provide some more details about what exception the server is throwing? Your original issue mentioned a java language exception, which is part of the Android SDK, not the server. If you could provide some consistent repro steps, that would be ideal.
I'll do that ASAP. But I don't think there was any exception printed to the log.
No response in many days, closing.
Dude, I don't have time for this at the moment. But this is a serious issue. Can you try to reproduce? IMHO you need to take a look into this. But for now I abandoned parse-server because of all these differences from the parse.com server.
We did try to reproduce and weren't able to. If you can post a small example code that reproduces the error, or a cURL request that has different behaviour on Parse.com and Parse Server (the API Console can help with that) then we will be able to help.