{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/3690","labels_url":"https://api.github.com/repos/emberjs/data/issues/3690/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/3690/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/3690/events","html_url":"https://github.com/emberjs/data/pull/3690","id":102636909,"number":3690,"title":"[BUGFIX release-1-13] Ensure that `service:store` is cleared before regsitering.","user":{"login":"rwjblue","id":12637,"avatar_url":"https://avatars.githubusercontent.com/u/12637?v=3","gravatar_id":"","url":"https://api.github.com/users/rwjblue","html_url":"https://github.com/rwjblue","followers_url":"https://api.github.com/users/rwjblue/followers","following_url":"https://api.github.com/users/rwjblue/following{/other_user}","gists_url":"https://api.github.com/users/rwjblue/gists{/gist_id}","starred_url":"https://api.github.com/users/rwjblue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rwjblue/subscriptions","organizations_url":"https://api.github.com/users/rwjblue/orgs","repos_url":"https://api.github.com/users/rwjblue/repos","events_url":"https://api.github.com/users/rwjblue/events{/privacy}","received_events_url":"https://api.github.com/users/rwjblue/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-23T16:38:54Z","updated_at":"2015-08-23T17:04:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/emberjs/data/pulls/3690","html_url":"https://github.com/emberjs/data/pull/3690","diff_url":"https://github.com/emberjs/data/pull/3690.diff","patch_url":"https://github.com/emberjs/data/pull/3690.patch"},"body":"In globals apps, calling `App.reset()` will cause these initializers to be ran multiple times for each `container` / `registry` instance.  This means that when `App.reset()` is called, `service:store` is already registered **AND** resolved, throwing the following error:\r\n\r\n```\r\nCannot re-register: `service:store`, as it has already been resolved.\r\n```\r\n\r\nThe fix is to `unregister` before `register`ing again.\r\n\r\nFixes https://github.com/emberjs/ember.js/issues/10310.\r\n\r\n---\r\n\r\nPlease note, this is already a non-issue in 2.0.0 (aka release branch).  This PR is targeting the `release-1-13` branch (which was branched from the `v1.13.11` tag)."},"comment":{"url":"https://api.github.com/repos/emberjs/data/issues/comments/133879230","html_url":"https://github.com/emberjs/data/pull/3690#issuecomment-133879230","issue_url":"https://api.github.com/repos/emberjs/data/issues/3690","id":133879230,"user":{"login":"bmac","id":54056,"avatar_url":"https://avatars.githubusercontent.com/u/54056?v=3","gravatar_id":"","url":"https://api.github.com/users/bmac","html_url":"https://github.com/bmac","followers_url":"https://api.github.com/users/bmac/followers","following_url":"https://api.github.com/users/bmac/following{/other_user}","gists_url":"https://api.github.com/users/bmac/gists{/gist_id}","starred_url":"https://api.github.com/users/bmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmac/subscriptions","organizations_url":"https://api.github.com/users/bmac/orgs","repos_url":"https://api.github.com/users/bmac/repos","events_url":"https://api.github.com/users/bmac/events{/privacy}","received_events_url":"https://api.github.com/users/bmac/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T17:04:46Z","updated_at":"2015-08-23T17:04:46Z","body":"@rwjblue In the 2.0 branch the initializer is using `has` to check if the store is already registered. Which I suspect is the reason this is not an issue with the 2.0 branch. Could this lead to some subtle sate bugs in 2.0 if an old store is not unregistered when calling `App.reset()`?\r\n\r\nhttps://github.com/emberjs/data/blob/52517662143daea47876ff257db95dce18ff8bbe/packages/ember-data/lib/initializers/store.js#L37-L39"}}