{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/4564","repository_url":"https://api.github.com/repos/emberjs/data","labels_url":"https://api.github.com/repos/emberjs/data/issues/4564/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/4564/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/4564/events","html_url":"https://github.com/emberjs/data/issues/4564","id":180247244,"number":4564,"title":"DS.Store findAll should have a param which states that the store cache should be invalidated before fetching from API","user":{"login":"mithmatt","id":5906984,"avatar_url":"https://avatars.githubusercontent.com/u/5906984?v=3","gravatar_id":"","url":"https://api.github.com/users/mithmatt","html_url":"https://github.com/mithmatt","followers_url":"https://api.github.com/users/mithmatt/followers","following_url":"https://api.github.com/users/mithmatt/following{/other_user}","gists_url":"https://api.github.com/users/mithmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/mithmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mithmatt/subscriptions","organizations_url":"https://api.github.com/users/mithmatt/orgs","repos_url":"https://api.github.com/users/mithmatt/repos","events_url":"https://api.github.com/users/mithmatt/events{/privacy}","received_events_url":"https://api.github.com/users/mithmatt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-30T08:22:42Z","updated_at":"2016-09-30T08:33:08Z","closed_at":null,"body":"In simple terms: I have a Java servlet which connects to a backend database. I'm working on a UI which shows the contents of the table in the database.\r\n\r\nMy route is refreshed every 15 seconds using an Ember.run loop.\r\nEvery 15 seconds, I would like to get the current data from the servlet (which would in turn go get it from the DB every time) - no caching involved at any layer.\r\n\r\nI use ```.findAll()``` on my model with ```reload: true``` param, but I end up having stale data in the store.\r\n\r\nExample:\r\nMy DB has 3 rows, namely:\r\n1-A\r\n2-B\r\n3-C\r\n\r\nAfter 15 seconds, row 1 vanished (someone deleted it), but row 2 and 3 ids remain the same, but some columns got updated so contents of the DB at this point are:\r\n2-D\r\n3-E\r\n\r\nWhen I do ```.findAll('myModel', {reload: true})```, I end up getting:\r\n1-A (stale data)\r\n2-D\r\n3-E\r\n\r\nTo get rid of the stale data, I always have to do this (the code block within the Ember.run loop):\r\n```javascript\r\nthis.store.unloadAll('myModel');\r\nthis.store.findAll('mymodel', {reload: true});\r\n```\r\n\r\nI have a component that renders based on any change in myModel. Doing unloadAll re-renders the component for a split second, and findAll re-renders the component again.\r\n\r\nIt would be awesome if I can send in another param to ```findAll``` like \r\n```javascript\r\nthis.store.findAll('mymodel', { invalidateCache: true, reload: true});\r\n```\r\n\r\nThe above code would instruct Ember to clear out the store, and go get the latest data from the REST API.\r\n\r\nWouldn't this be a nice feature for showing real time data on components which should strictly NOT depend on cache?"},"comment":{"url":"https://api.github.com/repos/emberjs/data/issues/comments/250689857","html_url":"https://github.com/emberjs/data/issues/4564#issuecomment-250689857","issue_url":"https://api.github.com/repos/emberjs/data/issues/4564","id":250689857,"user":{"login":"locks","id":32344,"avatar_url":"https://avatars.githubusercontent.com/u/32344?v=3","gravatar_id":"","url":"https://api.github.com/users/locks","html_url":"https://github.com/locks","followers_url":"https://api.github.com/users/locks/followers","following_url":"https://api.github.com/users/locks/following{/other_user}","gists_url":"https://api.github.com/users/locks/gists{/gist_id}","starred_url":"https://api.github.com/users/locks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/locks/subscriptions","organizations_url":"https://api.github.com/users/locks/orgs","repos_url":"https://api.github.com/users/locks/repos","events_url":"https://api.github.com/users/locks/events{/privacy}","received_events_url":"https://api.github.com/users/locks/received_events","type":"User","site_admin":false},"created_at":"2016-09-30T08:33:08Z","updated_at":"2016-09-30T08:33:08Z","body":"@mithmatt how are you triggering the actual reload of the data?"}}
{"actor":{"display_login":"locks"}}