{"action":"closed","issue":{"url":"https://api.github.com/repos/parse-community/Parse-SDK-iOS-OSX/issues/1331","repository_url":"https://api.github.com/repos/parse-community/Parse-SDK-iOS-OSX","labels_url":"https://api.github.com/repos/parse-community/Parse-SDK-iOS-OSX/issues/1331/labels{/name}","comments_url":"https://api.github.com/repos/parse-community/Parse-SDK-iOS-OSX/issues/1331/comments","events_url":"https://api.github.com/repos/parse-community/Parse-SDK-iOS-OSX/issues/1331/events","html_url":"https://github.com/parse-community/Parse-SDK-iOS-OSX/issues/1331","id":353414585,"node_id":"MDU6SXNzdWUzNTM0MTQ1ODU=","number":1331,"title":"saveAll only sends some objects to the Parse Server","user":{"login":"benpackard","id":2280914,"node_id":"MDQ6VXNlcjIyODA5MTQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2280914?v=4","gravatar_id":"","url":"https://api.github.com/users/benpackard","html_url":"https://github.com/benpackard","followers_url":"https://api.github.com/users/benpackard/followers","following_url":"https://api.github.com/users/benpackard/following{/other_user}","gists_url":"https://api.github.com/users/benpackard/gists{/gist_id}","starred_url":"https://api.github.com/users/benpackard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benpackard/subscriptions","organizations_url":"https://api.github.com/users/benpackard/orgs","repos_url":"https://api.github.com/users/benpackard/repos","events_url":"https://api.github.com/users/benpackard/events{/privacy}","received_events_url":"https://api.github.com/users/benpackard/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-23T14:42:27Z","updated_at":"2018-08-23T16:29:59Z","closed_at":"2018-08-23T16:29:59Z","author_association":"NONE","body":"Parse-SDK-iOS-OSX 1.17.1\r\nParse-Server 2.8.2\r\n\r\nI found a bug in my application where after calling `saveAll` on an array of Parse objects, only some had an `objectId` (typically about 2-3 of the objects saved). Observing the logs from Parse Server, I noticed that the request only included a subset of the objects. Furthermore, I observed the request being sent from the iOS device via Charles proxy and saw the same - only a few of the saved objects are present.\r\n\r\nIf I save each individually via a separate save operation, everything works as expected.\r\n\r\nHere is the iOS function that creates the objects (in this case a `Code` object, which I will also include)\r\n\r\n```\r\nclass Code: PFObject, PFSubclassing {\r\n\tstatic func parseClassName() -> String {\r\n\t\treturn \"Code\"\r\n\t}\r\n\r\n\t@NSManaged var note: Note?\r\n}\r\n```\r\n\r\n```\r\nlet codes = (1...5).map { _ in\r\n    return Code()\r\n}\r\nprint(codes.count) // 5\r\nPFObject.saveAll(inBackground: codes) { (success, error) in\r\n\tprint(success) // true\r\n\tprint(error) // nil\r\n\tprint(codes.count) // still 5\r\n\tfor code in codes {\r\n\t\tprint(code.objectId)\r\n\t}\r\n}\r\n```\r\n\r\nOutput: \r\n```\r\nOptional(\"dEnMEvf3jT\")\r\nOptional(\"xDSH1wLIUt\")\r\nnil\r\nnil\r\nnil\r\n```\r\n\r\nHere's the request sent as captured by Charles - notice only two objects are sent:\r\n\r\n```\r\n{\r\n\t\"requests\": [{\r\n\t\t\"path\": \"\\/parse\\/classes\\/Code\",\r\n\t\t\"method\": \"POST\",\r\n\t\t\"body\": {\r\n\t\t\t\"ACL\": {\r\n\t\t\t\t\"*\": {\r\n\t\t\t\t\t\"read\": true\r\n\t\t\t\t},\r\n\t\t\t\t\"6CtDuiWn4F\": {\r\n\t\t\t\t\t\"write\": true,\r\n\t\t\t\t\t\"read\": true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}, {\r\n\t\t\"path\": \"\\/parse\\/classes\\/Code\",\r\n\t\t\"method\": \"POST\",\r\n\t\t\"body\": {\r\n\t\t\t\"ACL\": {\r\n\t\t\t\t\"*\": {\r\n\t\t\t\t\t\"read\": true\r\n\t\t\t\t},\r\n\t\t\t\t\"6CtDuiWn4F\": {\r\n\t\t\t\t\t\"write\": true,\r\n\t\t\t\t\t\"read\": true\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}]\r\n}\r\n```\r\n\r\nAnd the Parse Server log:\r\n\r\n```\r\n2018-08-23T14:37:26.528601+00:00 app[web.1]: \u001B[36mverbose\u001B[39m: REQUEST for [POST] /parse/batch: {\r\n2018-08-23T14:37:26.528609+00:00 app[web.1]:   \"requests\": [\r\n2018-08-23T14:37:26.528610+00:00 app[web.1]:     {\r\n2018-08-23T14:37:26.528612+00:00 app[web.1]:       \"path\": \"/parse/classes/Code\",\r\n2018-08-23T14:37:26.528614+00:00 app[web.1]:       \"method\": \"POST\",\r\n2018-08-23T14:37:26.528616+00:00 app[web.1]:       \"body\": {\r\n2018-08-23T14:37:26.528617+00:00 app[web.1]:         \"ACL\": {\r\n2018-08-23T14:37:26.528619+00:00 app[web.1]:           \"*\": {\r\n2018-08-23T14:37:26.528621+00:00 app[web.1]:             \"read\": true\r\n2018-08-23T14:37:26.528622+00:00 app[web.1]:           },\r\n2018-08-23T14:37:26.528624+00:00 app[web.1]:           \"6CtDuiWn4F\": {\r\n2018-08-23T14:37:26.528626+00:00 app[web.1]:             \"write\": true,\r\n2018-08-23T14:37:26.528627+00:00 app[web.1]:             \"read\": true\r\n2018-08-23T14:37:26.528629+00:00 app[web.1]:           }\r\n2018-08-23T14:37:26.528630+00:00 app[web.1]:         }\r\n2018-08-23T14:37:26.528632+00:00 app[web.1]:       }\r\n2018-08-23T14:37:26.528633+00:00 app[web.1]:     },\r\n2018-08-23T14:37:26.528635+00:00 app[web.1]:     {\r\n2018-08-23T14:37:26.528637+00:00 app[web.1]:       \"path\": \"/parse/classes/Code\",\r\n2018-08-23T14:37:26.528638+00:00 app[web.1]:       \"method\": \"POST\",\r\n2018-08-23T14:37:26.528640+00:00 app[web.1]:       \"body\": {\r\n2018-08-23T14:37:26.528641+00:00 app[web.1]:         \"ACL\": {\r\n2018-08-23T14:37:26.528643+00:00 app[web.1]:           \"*\": {\r\n2018-08-23T14:37:26.528644+00:00 app[web.1]:             \"read\": true\r\n2018-08-23T14:37:26.528648+00:00 app[web.1]:           },\r\n2018-08-23T14:37:26.528650+00:00 app[web.1]:           \"6CtDuiWn4F\": {\r\n2018-08-23T14:37:26.528652+00:00 app[web.1]:             \"write\": true,\r\n2018-08-23T14:37:26.528653+00:00 app[web.1]:             \"read\": true\r\n2018-08-23T14:37:26.528655+00:00 app[web.1]:           }\r\n2018-08-23T14:37:26.528656+00:00 app[web.1]:         }\r\n2018-08-23T14:37:26.528658+00:00 app[web.1]:       }\r\n2018-08-23T14:37:26.528659+00:00 app[web.1]:     }\r\n2018-08-23T14:37:26.528661+00:00 app[web.1]:   ]\r\n2018-08-23T14:37:26.528663+00:00 app[web.1]: } method=POST, url=/parse/batch, host=outlinx-dev.herokuapp.com, connection=close, content-type=application/json; charset=utf-8, accept=*/*, x-parse-session-token=r:1840b0ffbaddbdd2155da9c0a2a68144, x-parse-application-id=ScupBUkHr2jWGj5Sr5feHfX2JqcbcZ6TcsrNXupU, x-parse-installation-id=055e083c-bc2a-44c6-9ca0-580d6261fdee, x-parse-os-version=11.4 (17G65), accept-language=en-us, accept-encoding=br, gzip, deflate, x-parse-client-version=i1.17.1, user-agent=Outlinx/19 CFNetwork/901.1 Darwin/17.7.0, x-parse-app-build-version=19, x-parse-app-display-version=1.0, x-request-id=84f16499-d181-4c32-84fb-3f0538096272, x-forwarded-for=73.201.134.22, x-forwarded-proto=https, x-forwarded-port=443, via=1.1 vegur, connect-time=1, x-request-start=1535035046518, total-route-time=0, content-length=264, requests=[path=/parse/classes/Code, method=POST, read=true, write=true, read=true, path=/parse/classes/Code, method=POST, read=true, write=true, read=true]\r\n2018-08-23T14:37:26.559305+00:00 app[web.1]: \u001B[36mverbose\u001B[39m: RESPONSE from [POST] /parse/batch: {\r\n2018-08-23T14:37:26.559309+00:00 app[web.1]:   \"response\": [\r\n2018-08-23T14:37:26.559311+00:00 app[web.1]:     {\r\n2018-08-23T14:37:26.559314+00:00 app[web.1]:       \"success\": {\r\n2018-08-23T14:37:26.559315+00:00 app[web.1]:         \"objectId\": \"dEnMEvf3jT\",\r\n2018-08-23T14:37:26.559317+00:00 app[web.1]:         \"createdAt\": \"2018-08-23T14:37:26.528Z\"\r\n2018-08-23T14:37:26.559319+00:00 app[web.1]:       }\r\n2018-08-23T14:37:26.559320+00:00 app[web.1]:     },\r\n2018-08-23T14:37:26.559322+00:00 app[web.1]:     {\r\n2018-08-23T14:37:26.559323+00:00 app[web.1]:       \"success\": {\r\n2018-08-23T14:37:26.559325+00:00 app[web.1]:         \"objectId\": \"xDSH1wLIUt\",\r\n2018-08-23T14:37:26.559326+00:00 app[web.1]:         \"createdAt\": \"2018-08-23T14:37:26.529Z\"\r\n2018-08-23T14:37:26.559328+00:00 app[web.1]:       }\r\n2018-08-23T14:37:26.559330+00:00 app[web.1]:     }\r\n2018-08-23T14:37:26.559331+00:00 app[web.1]:   ]\r\n2018-08-23T14:37:26.559333+00:00 app[web.1]: } response=[objectId=dEnMEvf3jT, createdAt=2018-08-23T14:37:26.528Z, objectId=xDSH1wLIUt, createdAt=2018-08-23T14:37:26.529Z]\r\n```"}}
{"actor":{"display_login":"benpackard"}}