{"action":"created","issue":{"url":"https://api.github.com/repos/davidkpiano/xstate/issues/198","repository_url":"https://api.github.com/repos/davidkpiano/xstate","labels_url":"https://api.github.com/repos/davidkpiano/xstate/issues/198/labels{/name}","comments_url":"https://api.github.com/repos/davidkpiano/xstate/issues/198/comments","events_url":"https://api.github.com/repos/davidkpiano/xstate/issues/198/events","html_url":"https://github.com/davidkpiano/xstate/issues/198","id":369994216,"node_id":"MDU6SXNzdWUzNjk5OTQyMTY=","number":198,"title":"Add absoluteId property to StateNode","user":{"login":"carloslfu","id":5993168,"node_id":"MDQ6VXNlcjU5OTMxNjg=","avatar_url":"https://avatars3.githubusercontent.com/u/5993168?v=4","gravatar_id":"","url":"https://api.github.com/users/carloslfu","html_url":"https://github.com/carloslfu","followers_url":"https://api.github.com/users/carloslfu/followers","following_url":"https://api.github.com/users/carloslfu/following{/other_user}","gists_url":"https://api.github.com/users/carloslfu/gists{/gist_id}","starred_url":"https://api.github.com/users/carloslfu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carloslfu/subscriptions","organizations_url":"https://api.github.com/users/carloslfu/orgs","repos_url":"https://api.github.com/users/carloslfu/repos","events_url":"https://api.github.com/users/carloslfu/events{/privacy}","received_events_url":"https://api.github.com/users/carloslfu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-15T04:25:52Z","updated_at":"2018-10-15T04:41:12Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Bug or feature request?\r\nFeature request\r\n## Description:\r\nRight now `StateNode`s ids are automatically set if the configuration doesn't provide one. The automatic ids are absolute `ids`, i.e. `(machine).stateA.a1`. I realized these ids are very useful when you are visiting the nodes. But, the problem is that if a state configuration has an id, it is overwritten so you can't rely on it. Right now I populate `data` config property with the absolute ids to always have absolute ids. I propose to add a property to `StateNode`s called `absoluteId`, and this way we can rely on it.\r\n"},"comment":{"url":"https://api.github.com/repos/davidkpiano/xstate/issues/comments/429706690","html_url":"https://github.com/davidkpiano/xstate/issues/198#issuecomment-429706690","issue_url":"https://api.github.com/repos/davidkpiano/xstate/issues/198","id":429706690,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTcwNjY5MA==","user":{"login":"davidkpiano","id":1093738,"node_id":"MDQ6VXNlcjEwOTM3Mzg=","avatar_url":"https://avatars2.githubusercontent.com/u/1093738?v=4","gravatar_id":"","url":"https://api.github.com/users/davidkpiano","html_url":"https://github.com/davidkpiano","followers_url":"https://api.github.com/users/davidkpiano/followers","following_url":"https://api.github.com/users/davidkpiano/following{/other_user}","gists_url":"https://api.github.com/users/davidkpiano/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkpiano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkpiano/subscriptions","organizations_url":"https://api.github.com/users/davidkpiano/orgs","repos_url":"https://api.github.com/users/davidkpiano/repos","events_url":"https://api.github.com/users/davidkpiano/events{/privacy}","received_events_url":"https://api.github.com/users/davidkpiano/received_events","type":"User","site_admin":false},"created_at":"2018-10-15T04:41:12Z","updated_at":"2018-10-15T04:41:12Z","author_association":"OWNER","body":"The `id` property is not overwritten:\r\n\r\n```ts\r\n// ...\r\n    this.id =\r\n      _config.id ||\r\n      (this.machine\r\n        ? [this.machine.key, ...this.path].join(this.delimiter)\r\n        : this.key);\r\n// ...\r\n```\r\n\r\nAm I missing something? Can you create a reproducible example where this is not the case? There is also a spec at `tests/id.test.ts` that ensures this behavior holds."}}
{"actor":{"display_login":"davidkpiano"}}