Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[WIP] MLIBZ-2513 - Locally created entity being pushed as a PUT rather than a POST. #169
Locally-created entities, unless they have explicitly had an ID set on it, should have the ID removed prior to pushing to the backend, and this should be done via a POST request. Currently, the ID field is being populated by a GUID from Realm, which is causing the push to be done via a PUT request. This is unexpected, and although the Kinvey backend is more forgiving for the PUT vs POST, things such as Flex services may not handle this.
Detect when there is no ID or when the entity has a Realm-generated ID, and remove it prior to performing the push operation. Ensure that this request is sent as a POST. Properly delete the entity in Realm when the response is successful, and add the entity returned, which includes the permanent ID, into Realm.
@@ Coverage Diff @@ ## indev #169 +/- ## ======================================== Coverage ? 57.97% Complexity ? 478 ======================================== Files ? 42 Lines ? 3172 Branches ? 480 ======================================== Hits ? 1839 Misses ? 1183 Partials ? 150