{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/strong-remoting/issues/143","repository_url":"https://api.github.com/repos/strongloop/strong-remoting","labels_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/143/comments","events_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/143/events","html_url":"https://github.com/strongloop/strong-remoting/issues/143","id":51200491,"number":143,"title":"coerce id \"0668\" detects integer, returns 688;","user":{"login":"BerkeleyTrue","id":6775919,"avatar_url":"https://avatars.githubusercontent.com/u/6775919?v=3","gravatar_id":"","url":"https://api.github.com/users/BerkeleyTrue","html_url":"https://github.com/BerkeleyTrue","followers_url":"https://api.github.com/users/BerkeleyTrue/followers","following_url":"https://api.github.com/users/BerkeleyTrue/following{/other_user}","gists_url":"https://api.github.com/users/BerkeleyTrue/gists{/gist_id}","starred_url":"https://api.github.com/users/BerkeleyTrue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BerkeleyTrue/subscriptions","organizations_url":"https://api.github.com/users/BerkeleyTrue/orgs","repos_url":"https://api.github.com/users/BerkeleyTrue/repos","events_url":"https://api.github.com/users/BerkeleyTrue/events{/privacy}","received_events_url":"https://api.github.com/users/BerkeleyTrue/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/strong-remoting/labels/bug","name":"bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":{"login":"ritch","id":462228,"avatar_url":"https://avatars.githubusercontent.com/u/462228?v=3","gravatar_id":"","url":"https://api.github.com/users/ritch","html_url":"https://github.com/ritch","followers_url":"https://api.github.com/users/ritch/followers","following_url":"https://api.github.com/users/ritch/following{/other_user}","gists_url":"https://api.github.com/users/ritch/gists{/gist_id}","starred_url":"https://api.github.com/users/ritch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritch/subscriptions","organizations_url":"https://api.github.com/users/ritch/orgs","repos_url":"https://api.github.com/users/ritch/repos","events_url":"https://api.github.com/users/ritch/events{/privacy}","received_events_url":"https://api.github.com/users/ritch/received_events","type":"User","site_admin":false},"assignees":[{"login":"ritch","id":462228,"avatar_url":"https://avatars.githubusercontent.com/u/462228?v=3","gravatar_id":"","url":"https://api.github.com/users/ritch","html_url":"https://github.com/ritch","followers_url":"https://api.github.com/users/ritch/followers","following_url":"https://api.github.com/users/ritch/following{/other_user}","gists_url":"https://api.github.com/users/ritch/gists{/gist_id}","starred_url":"https://api.github.com/users/ritch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ritch/subscriptions","organizations_url":"https://api.github.com/users/ritch/orgs","repos_url":"https://api.github.com/users/ritch/repos","events_url":"https://api.github.com/users/ritch/events{/privacy}","received_events_url":"https://api.github.com/users/ritch/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2014-12-06T23:27:29Z","updated_at":"2016-09-12T12:03:47Z","closed_at":"2016-05-04T14:30:06Z","body":"Using model id's that allow for leading zero's and all number characters causes the coerce function in http-context.js [here](https://github.com/strongloop/strong-remoting/blob/67d4b139f323ce2a5e7a2e785320f66776275e92/lib/http-context.js#L188) to change model ids to integers and remove leading zeros.\r\n\r\nThis was causing a new model to be created with id 688 and model '0688' was not being updated. \r\n\r\nNot sure if this was intended, but I will be making sure all id's require at least one alpha character to avoid this, but wanted to have some record of this for future reference."},"comment":{"url":"https://api.github.com/repos/strongloop/strong-remoting/issues/comments/246326829","html_url":"https://github.com/strongloop/strong-remoting/issues/143#issuecomment-246326829","issue_url":"https://api.github.com/repos/strongloop/strong-remoting/issues/143","id":246326829,"user":{"login":"bajtos","id":1140553,"avatar_url":"https://avatars.githubusercontent.com/u/1140553?v=3","gravatar_id":"","url":"https://api.github.com/users/bajtos","html_url":"https://github.com/bajtos","followers_url":"https://api.github.com/users/bajtos/followers","following_url":"https://api.github.com/users/bajtos/following{/other_user}","gists_url":"https://api.github.com/users/bajtos/gists{/gist_id}","starred_url":"https://api.github.com/users/bajtos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajtos/subscriptions","organizations_url":"https://api.github.com/users/bajtos/orgs","repos_url":"https://api.github.com/users/bajtos/repos","events_url":"https://api.github.com/users/bajtos/events{/privacy}","received_events_url":"https://api.github.com/users/bajtos/received_events","type":"User","site_admin":false},"created_at":"2016-09-12T12:03:47Z","updated_at":"2016-09-12T12:03:47Z","body":"The issue is fixed in the upcoming 3.0 release.\r\n\r\n- When the argument's type is `any`, strong-remoting will treat integer numbers starting with `0` as string, e.g. `0668` will preserve the leading zero. However, floats are still converted to numbers, e.g. both `0.42` and `00.42` are converted to a number.\r\n\r\n- When the argument's type is `number` or `integer`, strong-remoting will treat integer numbers starting with `0` as numbers and discarding any extra leading zeroes."}}
{"actor":{"display_login":"bajtos"}}