{"action":"created","issue":{"url":"https://api.github.com/repos/dockyard/ember-cli-i18n/issues/69","labels_url":"https://api.github.com/repos/dockyard/ember-cli-i18n/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/dockyard/ember-cli-i18n/issues/69/comments","events_url":"https://api.github.com/repos/dockyard/ember-cli-i18n/issues/69/events","html_url":"https://github.com/dockyard/ember-cli-i18n/issues/69","id":56615966,"number":69,"title":"Assertion Failed: calling set on destroyed object (the app object)","user":{"login":"gnapse","id":15199,"avatar_url":"https://avatars.githubusercontent.com/u/15199?v=3","gravatar_id":"","url":"https://api.github.com/users/gnapse","html_url":"https://github.com/gnapse","followers_url":"https://api.github.com/users/gnapse/followers","following_url":"https://api.github.com/users/gnapse/following{/other_user}","gists_url":"https://api.github.com/users/gnapse/gists{/gist_id}","starred_url":"https://api.github.com/users/gnapse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnapse/subscriptions","organizations_url":"https://api.github.com/users/gnapse/orgs","repos_url":"https://api.github.com/users/gnapse/repos","events_url":"https://api.github.com/users/gnapse/events{/privacy}","received_events_url":"https://api.github.com/users/gnapse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-02-05T01:47:17Z","updated_at":"2015-07-02T14:04:25Z","closed_at":null,"body":"I have the following observer in the session controller of my app.\r\n\r\n```coffeescript\r\n  onLocaleChanged: (->\r\n    app = @container.lookup('application:main')\r\n    currentLocale = Ember.get(app, 'locale') || app.defaultLocale\r\n    newLocale = Ember.get(this, 'currentUser.locale') || app.defaultLocale\r\n    if newLocale != currentLocale\r\n      Ember.set(app, 'locale', newLocale)\r\n  ).observes('currentUser.locale')\r\n```\r\n\r\nThis controller has a `currentUser` property, and the user has a `locale` property. The intention is that, whenever the value of `currentUser.locale` changes (either because the current user changed, or its locale changed) to update the app locale, so that the user interface is shown in the new locale.\r\n\r\nThe problem is that on the line `Ember.set(app, 'locale', newLocale)` I sometimes get the following error:\r\n\r\n```\r\nAssertion Failed: calling set on destroyed object\r\n```\r\n\r\nI've noticed that this never happens on the first time the locale changes once the app is loaded on a browser tab. But the second time the language changes this occurs.\r\n\r\nIt appears that the app object that I'm getting is cached on the first call to this observer, and then when called on the second time, the cached app reference is no longer relevant. But this is all me guessing. I really have no idea if this is the reason, and if it is, how to solve it."},"comment":{"url":"https://api.github.com/repos/dockyard/ember-cli-i18n/issues/comments/118043741","html_url":"https://github.com/dockyard/ember-cli-i18n/issues/69#issuecomment-118043741","issue_url":"https://api.github.com/repos/dockyard/ember-cli-i18n/issues/69","id":118043741,"user":{"login":"digitalbreed","id":826466,"avatar_url":"https://avatars.githubusercontent.com/u/826466?v=3","gravatar_id":"","url":"https://api.github.com/users/digitalbreed","html_url":"https://github.com/digitalbreed","followers_url":"https://api.github.com/users/digitalbreed/followers","following_url":"https://api.github.com/users/digitalbreed/following{/other_user}","gists_url":"https://api.github.com/users/digitalbreed/gists{/gist_id}","starred_url":"https://api.github.com/users/digitalbreed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/digitalbreed/subscriptions","organizations_url":"https://api.github.com/users/digitalbreed/orgs","repos_url":"https://api.github.com/users/digitalbreed/repos","events_url":"https://api.github.com/users/digitalbreed/events{/privacy}","received_events_url":"https://api.github.com/users/digitalbreed/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T14:04:25Z","updated_at":"2015-07-02T14:04:25Z","body":"Joining the unhappy crowd experiencing this issue. Any news on this?"}}