{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/ember.js/issues/10739","labels_url":"https://api.github.com/repos/emberjs/ember.js/issues/10739/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/ember.js/issues/10739/comments","events_url":"https://api.github.com/repos/emberjs/ember.js/issues/10739/events","html_url":"https://github.com/emberjs/ember.js/issues/10739","id":64792436,"number":10739,"title":"{{component}} helper race condition with associated model","user":{"login":"trentmwillis","id":3526753,"avatar_url":"https://avatars.githubusercontent.com/u/3526753?v=3","gravatar_id":"","url":"https://api.github.com/users/trentmwillis","html_url":"https://github.com/trentmwillis","followers_url":"https://api.github.com/users/trentmwillis/followers","following_url":"https://api.github.com/users/trentmwillis/following{/other_user}","gists_url":"https://api.github.com/users/trentmwillis/gists{/gist_id}","starred_url":"https://api.github.com/users/trentmwillis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trentmwillis/subscriptions","organizations_url":"https://api.github.com/users/trentmwillis/orgs","repos_url":"https://api.github.com/users/trentmwillis/repos","events_url":"https://api.github.com/users/trentmwillis/events{/privacy}","received_events_url":"https://api.github.com/users/trentmwillis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-03-27T16:01:21Z","updated_at":"2015-04-05T08:45:05Z","closed_at":null,"body":"The `{{component}}` helper seems to have a race condition that is causing problems to surface in tests that I am writing.\r\n\r\nUsage is like so:\r\n\r\n```handlebars\r\n{{component card.componentType model=card}}\r\n```\r\n\r\nThen when tests are run, a failure occurs during the `afterEach` when `destroy` is run on the `application` instance.\r\n\r\n![screen shot 2015-03-27 at 8 56 31 am](https://cloud.githubusercontent.com/assets/3526753/6871363/3ba316d2-d45f-11e4-9dc5-2a58f2e54968.png)\r\n\r\nIf I change the above usage to use a static string rather than a model property like so:\r\n\r\n```handlebars\r\n{{component `card/my-type` model=card}}\r\n```\r\n\r\nThe tests and teardown are fine. This leads me to believe it's being caused by the model being destroyed before the component, resulting in the component having a type of `undefined`.\r\n\r\nPotentially related PR, [#10302](https://github.com/emberjs/ember.js/pull/10302)"},"comment":{"url":"https://api.github.com/repos/emberjs/ember.js/issues/comments/89735916","html_url":"https://github.com/emberjs/ember.js/issues/10739#issuecomment-89735916","issue_url":"https://api.github.com/repos/emberjs/ember.js/issues/10739","id":89735916,"user":{"login":"nathanhammond","id":20542,"avatar_url":"https://avatars.githubusercontent.com/u/20542?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanhammond","html_url":"https://github.com/nathanhammond","followers_url":"https://api.github.com/users/nathanhammond/followers","following_url":"https://api.github.com/users/nathanhammond/following{/other_user}","gists_url":"https://api.github.com/users/nathanhammond/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanhammond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanhammond/subscriptions","organizations_url":"https://api.github.com/users/nathanhammond/orgs","repos_url":"https://api.github.com/users/nathanhammond/repos","events_url":"https://api.github.com/users/nathanhammond/events{/privacy}","received_events_url":"https://api.github.com/users/nathanhammond/received_events","type":"User","site_admin":false},"created_at":"2015-04-05T08:45:05Z","updated_at":"2015-04-05T08:45:05Z","body":"More information (notes for me): [willDestroy](https://github.com/emberjs/ember.js/blob/90397ef15453da1cba1f6bda374e075f054bfdf4/packages/ember-views/lib/views/bound_component_view.js#L25) is called *after* the stream [subscribed to here](https://github.com/emberjs/ember.js/blob/90397ef15453da1cba1f6bda374e075f054bfdf4/packages/ember-views/lib/views/bound_component_view.js#L22) is updated–meaning that `isDestroying` is not yet set."}}