{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/orleans/issues/1043","labels_url":"https://api.github.com/repos/dotnet/orleans/issues/1043/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/1043/comments","events_url":"https://api.github.com/repos/dotnet/orleans/issues/1043/events","html_url":"https://github.com/dotnet/orleans/pull/1043","id":117861191,"number":1043,"title":"Add ToStringKeyWithoutType to GrainReference","user":{"login":"shayhatsor","id":12084632,"avatar_url":"https://avatars.githubusercontent.com/u/12084632?v=3","gravatar_id":"","url":"https://api.github.com/users/shayhatsor","html_url":"https://github.com/shayhatsor","followers_url":"https://api.github.com/users/shayhatsor/followers","following_url":"https://api.github.com/users/shayhatsor/following{/other_user}","gists_url":"https://api.github.com/users/shayhatsor/gists{/gist_id}","starred_url":"https://api.github.com/users/shayhatsor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shayhatsor/subscriptions","organizations_url":"https://api.github.com/users/shayhatsor/orgs","repos_url":"https://api.github.com/users/shayhatsor/repos","events_url":"https://api.github.com/users/shayhatsor/events{/privacy}","received_events_url":"https://api.github.com/users/shayhatsor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-19T17:14:13Z","updated_at":"2015-11-20T17:08:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dotnet/orleans/pulls/1043","html_url":"https://github.com/dotnet/orleans/pull/1043","diff_url":"https://github.com/dotnet/orleans/pull/1043.diff","patch_url":"https://github.com/dotnet/orleans/pull/1043.patch"},"body":"I'm currently trying to implement an `IStorageProvider`.\r\nThe problem I'm facing is the lack of a method to get the original key provided by the user.\r\nAFAIK, Orleans flattens the key to `UniqueKey` which I don't see any way to convert back.\r\nI've implemented a method that attempts to do that, but it assumes too much. \r\nthe problem is that a `GUID` that its first half is zeros is saved the same as a `long`.\r\nthe `UniqueKey.IsLongKey` always returns true if the first half is zeroes.\r\n[this](https://github.com/dotnet/orleans/blob/master/src/Orleans/IDs/UniqueKey.cs#L136) is a bug, but fixing it will mean you can't use a long key equals to zero or a guid with all zeroes.\r\nI thought about adding another enum value to `UniqueKey.Category` but that will break any current reminders kept without it.\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/orleans/issues/comments/158461908","html_url":"https://github.com/dotnet/orleans/pull/1043#issuecomment-158461908","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/1043","id":158461908,"user":{"login":"sergeybykov","id":8248806,"avatar_url":"https://avatars.githubusercontent.com/u/8248806?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeybykov","html_url":"https://github.com/sergeybykov","followers_url":"https://api.github.com/users/sergeybykov/followers","following_url":"https://api.github.com/users/sergeybykov/following{/other_user}","gists_url":"https://api.github.com/users/sergeybykov/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeybykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeybykov/subscriptions","organizations_url":"https://api.github.com/users/sergeybykov/orgs","repos_url":"https://api.github.com/users/sergeybykov/repos","events_url":"https://api.github.com/users/sergeybykov/events{/privacy}","received_events_url":"https://api.github.com/users/sergeybykov/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T17:08:15Z","updated_at":"2015-11-20T17:08:15Z","body":"This is an interesting problem that we've been pushing out for a long time. From the beginning a `long` key was considered a shortcut for a `Guid` with half of it set to zero. I think I like the idea of explicitly preserving the type of key that was used. I am not convinced though that the proposed expanded `Category` enum is a good solution. We have system targets and system grains that can also be used today with either a `Guid` or a `long` key. Maybe a separate flag would be a better solution that would avoid explosion of permutations in the `Category` enum? We could also use that flag to disambiguate compound vs. string-only key."}}