For a simple overview screen I have a route that sets up a controller that does an App.Location.find(). I naively assumed that this would simply go to the store and fetch me all the records, giving me an up-to-date view of the records.
- When an external process starts removing records from the database, the App.Location.find() keeps on returning these deleted records. (although the REST call doesn’t show them anymore)
- If an external process starts adding records to the database, the App.Location.find() picks them up.
- If I delete the records form within the Ember app itself the model is correctly updated.
How should I deal with this in my Ember app ? I’d like to have an up-to-date view on whatever is in my database. Right now I need to refresh the page (F5) to get an up to date view. Using the linkTo helpers shows me the stale data.
This seems to be yet another trivial thing that I completely missed in EmberJS. Is it somewhere mentioned in the docs why it behaves like that ? I guess there is a valid philosophy behind this behavior.
My overview screens is simply interested in showing the most up-to-date data. If a record is no longer in the DB the model should not return it anymore.
Posted this question on SO as well : http://stackoverflow.com/questions/16380143/emberjs-model-find-not-up-to-date-with-underlying-store
It’s becoming increasingly more difficult to avoid utter frustration