{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/518","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/518/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/518/comments","events_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/518/events","html_url":"https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/518","id":115346643,"number":518,"title":"Apparent caching issue with Array of Custom Objects stored in Custom Object","user":{"login":"craiggrummitt","id":5923204,"avatar_url":"https://avatars.githubusercontent.com/u/5923204?v=3","gravatar_id":"","url":"https://api.github.com/users/craiggrummitt","html_url":"https://github.com/craiggrummitt","followers_url":"https://api.github.com/users/craiggrummitt/followers","following_url":"https://api.github.com/users/craiggrummitt/following{/other_user}","gists_url":"https://api.github.com/users/craiggrummitt/gists{/gist_id}","starred_url":"https://api.github.com/users/craiggrummitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craiggrummitt/subscriptions","organizations_url":"https://api.github.com/users/craiggrummitt/orgs","repos_url":"https://api.github.com/users/craiggrummitt/repos","events_url":"https://api.github.com/users/craiggrummitt/events{/privacy}","received_events_url":"https://api.github.com/users/craiggrummitt/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/labels/needs%20investigation","name":"needs investigation","color":"ffeea9"}],"state":"closed","locked":false,"assignee":{"login":"richardjrossiii","id":699752,"avatar_url":"https://avatars.githubusercontent.com/u/699752?v=3","gravatar_id":"","url":"https://api.github.com/users/richardjrossiii","html_url":"https://github.com/richardjrossiii","followers_url":"https://api.github.com/users/richardjrossiii/followers","following_url":"https://api.github.com/users/richardjrossiii/following{/other_user}","gists_url":"https://api.github.com/users/richardjrossiii/gists{/gist_id}","starred_url":"https://api.github.com/users/richardjrossiii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardjrossiii/subscriptions","organizations_url":"https://api.github.com/users/richardjrossiii/orgs","repos_url":"https://api.github.com/users/richardjrossiii/repos","events_url":"https://api.github.com/users/richardjrossiii/events{/privacy}","received_events_url":"https://api.github.com/users/richardjrossiii/received_events","type":"User","site_admin":false},"milestone":null,"comments":6,"created_at":"2015-11-05T18:41:48Z","updated_at":"2015-11-06T15:56:38Z","closed_at":"2015-11-05T21:48:08Z","body":"There seems to be some sort of caching issue with an Array of Custom Objects. I have included a link to a bare bones example of this problem. Let me describe the bare bones app, then the issue:\r\n\r\nApp:\r\nSimple chat app with one channel, only functionality is displaying all messages, and add message. I have a custom class 'Message' and 'Chat' (which stores an array of Messages). Messages are displayed in a UITableView, and there is a button to 'reload' the chat using a query. The query uses 'includeKey' to ensure that the messages array is included. When the app starts up, if no chat exists, it creates one with a blank messages array.\r\n\r\nThe only changes to this app from the Parse Starter Project are: Chat.swift, Message.swift, AppDelegate.swift(to set the application id and register subclasses), ViewController.swift and the storyboard.\r\n\r\nProblem:\r\nThe query seems to retrieve cached data (i.e. it doesn't update with updates in the data).\r\n\r\nFrom my testing, the device that generates the 'Chat' object initially does not present this problem. However, the device that did not initially generate the 'Chat' object, does present this problem.\r\n\r\nSteps to produce this problem:\r\n1. Download the sample code [here](https://github.com/craiggrummitt/ParseCustomObjectArrayQueryBug).\r\n2. You will need two devices. Install the app on first device(Device A). Note that as the query came back with no 'Chat' objects that it generated one. Double check in Parse Core that this 'Chat' object was generated. \r\n3. Run the app on the other device (Device B) This time the query comes back with a Chat object.\r\n3. Add a message on Device A by tapping the plus button and then save. Note this saves the message, and then reloads the query and the table. Double check the message was saved in Core.\r\n4. Reload the table on Device B - message should appear. Great!\r\n5. Add a message on Device B, same as step 3. The message should be returned by the query. Double check the message was saved in Core.\r\n6. Reload the table on Device A - huh? The message doesn't appear. Triple check the message was saved in Core. It was right? Why doesn't the query return it?\r\n7. Scratch head.\r\n8. Build and run the app on Device A again - now the message does appear. What the? Is this a caching problem?\r\n\r\nAdditional diagnostic notes:\r\nIn my actual app I had implemented a limit of 20 messages, and after that the first message was deleted. I noticed that after I started deleting messages, that this apparent caching problem stopped occurring."},"comment":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/comments/154447079","html_url":"https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/518#issuecomment-154447079","issue_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/518","id":154447079,"user":{"login":"craiggrummitt","id":5923204,"avatar_url":"https://avatars.githubusercontent.com/u/5923204?v=3","gravatar_id":"","url":"https://api.github.com/users/craiggrummitt","html_url":"https://github.com/craiggrummitt","followers_url":"https://api.github.com/users/craiggrummitt/followers","following_url":"https://api.github.com/users/craiggrummitt/following{/other_user}","gists_url":"https://api.github.com/users/craiggrummitt/gists{/gist_id}","starred_url":"https://api.github.com/users/craiggrummitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craiggrummitt/subscriptions","organizations_url":"https://api.github.com/users/craiggrummitt/orgs","repos_url":"https://api.github.com/users/craiggrummitt/repos","events_url":"https://api.github.com/users/craiggrummitt/events{/privacy}","received_events_url":"https://api.github.com/users/craiggrummitt/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T15:56:38Z","updated_at":"2015-11-06T15:56:38Z","body":"Great! Thanks for the reply @nlutsenko "}}