{"action":"created","issue":{"url":"https://api.github.com/repos/schulz3000/deepstreamNet/issues/29","repository_url":"https://api.github.com/repos/schulz3000/deepstreamNet","labels_url":"https://api.github.com/repos/schulz3000/deepstreamNet/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/schulz3000/deepstreamNet/issues/29/comments","events_url":"https://api.github.com/repos/schulz3000/deepstreamNet/issues/29/events","html_url":"https://github.com/schulz3000/deepstreamNet/issues/29","id":256933043,"number":29,"title":"DeepStreamRecordBase Parse failed when listening to a new list","user":{"login":"grendo","id":433894,"avatar_url":"https://avatars0.githubusercontent.com/u/433894?v=4","gravatar_id":"","url":"https://api.github.com/users/grendo","html_url":"https://github.com/grendo","followers_url":"https://api.github.com/users/grendo/followers","following_url":"https://api.github.com/users/grendo/following{/other_user}","gists_url":"https://api.github.com/users/grendo/gists{/gist_id}","starred_url":"https://api.github.com/users/grendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grendo/subscriptions","organizations_url":"https://api.github.com/users/grendo/orgs","repos_url":"https://api.github.com/users/grendo/repos","events_url":"https://api.github.com/users/grendo/events{/privacy}","received_events_url":"https://api.github.com/users/grendo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-12T06:36:43Z","updated_at":"2017-09-12T20:06:39Z","closed_at":null,"author_association":"NONE","body":"I got a crash in the Parse method of DeepStreamRecordBase when listening to changes on a new list and adding a item on a different connection.  I patched the Parse method to get it working\r\n\r\n```\r\n                var arrayParentPath = path.Substring(0, path.Length - (path.LastIndexOf(\"[\", StringComparison.Ordinal) + 1));\r\n                **if (path.StartsWith(\"[\") && path.EndsWith(\"]\"))\r\n                {\r\n                    arrayParentPath = \"\";\r\n                }**\r\n                var token = Data.SelectToken(arrayParentPath);\r\n                ((JArray)token).Add(item);\r\n\r\n\r\n```\r\nBelow is a test to reproduce.\r\n\r\n```\r\n        [Test]\r\n        public async Task TestAddingARecordToListAndListenToChanges()\r\n        {\r\n            var name = Guid.NewGuid().ToString();\r\n            var key = \"testrecord/\" + Guid.NewGuid().ToString();\r\n            var listKey = \"testlist/\" + Guid.NewGuid().ToString();\r\n            using (var updateClient = await GetConnection(\"admin\", \"test\"))\r\n            {\r\n                var list = await updateClient.Records.GetListAsync(listKey);\r\n\r\n                var rec = await updateClient.Records.GetRecordAsync(key);\r\n                var res = await updateClient.Records.SetWithAckAsync(rec, \"name\", name);\r\n                Assert.IsTrue(res);\r\n                using (var readClient = await GetConnection(\"admin\", \"test\"))\r\n                {\r\n\r\n                    var listRead = await readClient.Records.GetListAsync(listKey);\r\n                    var changes = new List<NotifyCollectionChangedEventArgs>();\r\n                    listRead.CollectionChanged += (sender, args) =>\r\n                    {\r\n                        changes.Add(args);\r\n                    };\r\n                    list.Add(rec.RecordName);\r\n                    while (changes.Count == 0)\r\n                    {\r\n                        await Task.Delay(200);\r\n                    }\r\n                    Assert.IsTrue(changes.Count(e => e.Action == NotifyCollectionChangedAction.Add) == 1);\r\n                }\r\n            }\r\n        }\r\n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/schulz3000/deepstreamNet/issues/comments/328969248","html_url":"https://github.com/schulz3000/deepstreamNet/issues/29#issuecomment-328969248","issue_url":"https://api.github.com/repos/schulz3000/deepstreamNet/issues/29","id":328969248,"user":{"login":"grendo","id":433894,"avatar_url":"https://avatars0.githubusercontent.com/u/433894?v=4","gravatar_id":"","url":"https://api.github.com/users/grendo","html_url":"https://github.com/grendo","followers_url":"https://api.github.com/users/grendo/followers","following_url":"https://api.github.com/users/grendo/following{/other_user}","gists_url":"https://api.github.com/users/grendo/gists{/gist_id}","starred_url":"https://api.github.com/users/grendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grendo/subscriptions","organizations_url":"https://api.github.com/users/grendo/orgs","repos_url":"https://api.github.com/users/grendo/repos","events_url":"https://api.github.com/users/grendo/events{/privacy}","received_events_url":"https://api.github.com/users/grendo/received_events","type":"User","site_admin":false},"created_at":"2017-09-12T20:06:39Z","updated_at":"2017-09-12T20:06:39Z","author_association":"NONE","body":"yep will get it done"}}
{"actor":{"display_login":"grendo"}}