Skip to content

Not allowing setObjectId() in ParseInstallation #611

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

Merged

Conversation

hermanliang
Copy link
Contributor

@hermanliang hermanliang commented Mar 23, 2017

When I deal with the issue #607, I found another issue about ParseInstallation.
(It's a very special case, generally should not happen.)

ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.setObjectId(null);
// put some parameters here
installation.save();

I originally expected another installation data will be created in the server.
But the installation data is updated successfully and doesn't return any exceptions.
The objectId of cached installation data is also cleared (null).
It seems parser server will refer to 'installationId' when updating the installation data.
In this case, the installation data is not re-created when it is deleted on the server. (will throw Code 135: MissingRequiredFieldError exception)
I think it should be restricted the usage of setObjectId() in ParseInstallation.

@codecov
Copy link

codecov bot commented Apr 6, 2017

Codecov Report

Merging #611 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #611      +/-   ##
============================================
- Coverage     52.58%   52.56%   -0.02%     
  Complexity     1664     1664              
============================================
  Files           131      131              
  Lines         10138    10139       +1     
  Branches       1407     1407              
============================================
- Hits           5331     5330       -1     
- Misses         4368     4369       +1     
- Partials        439      440       +1
Impacted Files Coverage Δ Complexity Δ
...rse/src/main/java/com/parse/ParseInstallation.java 75.96% <100%> (+0.23%) 40 <1> (+1) ⬆️
Parse/src/main/java/com/parse/ParseObject.java 50.3% <0%> (-0.14%) 200% <0%> (-1%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6223d06...712b168. Read the comment docs.

@rogerhu
Copy link
Contributor

rogerhu commented Apr 19, 2017

rebase

@hermanliang hermanliang force-pushed the parseinstallation-setobjectid branch from 1e081c8 to 712b168 Compare April 20, 2017 05:18
@rogerhu rogerhu merged commit f5188d6 into parse-community:master Apr 20, 2017
@hermanliang hermanliang deleted the parseinstallation-setobjectid branch April 21, 2017 01:22
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

Successfully merging this pull request may close these issues.

3 participants