-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Exception while saving a ParseObject with CurrentInstallation set as a property #2090
Comments
No activity. Checking if this was even seen by anyone... |
I am getting this as well when I try to do the following in the Unity SDK:
Would like to know if anyone finds a solution, I'll post here if I figure it out too. |
@drew-gross, @nlutsenko do you know why we require installationId or deviceToken to be set on Installations? Is that 'really' required? |
@thewizster Did you ever end up figuring this one out? I find it strange that it says that an installationId must be specified, yet in the logs you can see "x-parse-installation-id" is actually set, which I assume is the installationId in question. I have attached my logs below if it will help to debug / replicate.
|
@miracle7 I still haven't solved this either. Thanks for posting. Maybe we will get more feedback from Parse contributors. @drew-gross, @nlutsenko, @flovilmart |
I've recently worked in that area, and I believe I may have an idea on how to solve that issue. Thanks for posting the logs, that will help craft a reproduction case |
There is an obvious fix for that issue, before opening the PR, I'd like to get a 2nd opinion with @drew-gross or @nlutsenko The fix would involve:
fixing the x-parse-installation-id only set on auth (https://github.com/ParsePlatform/parse-server/blob/master/src/RestWrite.js#L574) is mentioned. I tested against parse.com and the X-Parse-Installation-Id header is not used in that matter. and the body defined installationId will take precedence on the headers |
Thanks @flovilmart. Hopefully we can see a fix for this soon, since it is holding up the release of our app (can't associate user with installation, so can't send push notifications to specific users). |
FYI our situation is as follows: Our current production app has been live for about a month (1.8.4), and has parse server enabled. The next version of our app (1.8.5) allows the user to login with facebook and specify a language to receive push notifications in, but due to this bug where only the first save of CurrentInstallation works the user and language are not associated with the install, since the successful first save is already used up by the previous version when saving the deviceId column. My workaround for people who start on 1.8.5 is to just save the deviceId at the same time that I associate the user and language so we only save once, but I don't really know what to do for people who are upgrading. I am thinking maybe I can create a new class to store the association between deviceId and users, then use that to get the appropriate installation, but it would be much easier if I could just save new information to Installations. |
I've just found a workaround for this issue (although I have no idea why it works). This line solves the issue with deviceToken:
but then there's one more issue to solve: "deviceType must be specified in this operation" - you could solve it the same way, unless the SDK told you that you "Cannot change the Than the rest will be like this:
|
The commit has been merged for a while, I believe it should be fixed by now. Can you update to the latest version and let us know if it works correctly? |
I'm seeing this issue on parse_server 2.2.19 connecting with the iOS/OS X sdk. Haven't tried 2.2.21 yet. I changed all of my installation saves to saveEventually(). I wasn't getting this error with the hosted version of parse.
To associate the user with the installation:
And then I set a few custom properties to mark when data was refreshed after the user has logged in.
The server error:
|
@reidmweber can you run the server with VERBOSE=1 please and report the full logs relevant to what you're noticing? |
Wow. that filled up the logs fast. :) Here is the verbose data:
Here is the iOS call:
|
That'S perfect! I'll have a look! |
@reidmweber submitter the RP, once it will be merged you'll be able to test it by pointing parse-server to |
Experiencing exception while saving a ParseObject with CurrentInstallation set as a property.
Parse.ParseException: at least one ID field (deviceToken, installationId) must be specified in this operation
I have verified that installation ID is set on the CurrentInstallation object before calling SaveAsync.
The code below will save to parse-server on first run when the app is installed. Then, each time the code is run it throws an exception and does not save to parse-server.
Below is the gist of the code. For full code see this repo link:
https://github.com/thewizster/hello-parse-installation/blob/master/HelloParse/HelloViewModel.cs
Steps to reproduce
This can be reproduced using this sample code at:
https://github.com/thewizster/hello-parse-installation
Expected Results
A new ParseObject (Class: World) should be saved to parse-server and have a pointer to the installation of the device that saved it. Here is an example from the MongoDb of a successful object saved.
Actual Outcome
When calling SaveAsync on the new ParseObject the save will fail and result in the following exception:
Parse.ParseException: at least one ID field (deviceToken, installationId) must be specified in this operation
Environment Setup
Parse .NET SDK v1.7.0
parse-server v2.2.13
Xamarin.iOS 9.8.0.323
iOS v9.3.2
Visual Studio 2015
Logs/Trace
App is updating and saving CurrentInstallation upon launch. Works.
App attempts SaveAsync on the new ParseObject. Fails
Client stacktrace
The text was updated successfully, but these errors were encountered: