{"action":"created","issue":{"url":"https://api.github.com/repos/ravendb/bootcamp/issues/29","repository_url":"https://api.github.com/repos/ravendb/bootcamp","labels_url":"https://api.github.com/repos/ravendb/bootcamp/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/ravendb/bootcamp/issues/29/comments","events_url":"https://api.github.com/repos/ravendb/bootcamp/issues/29/events","html_url":"https://github.com/ravendb/bootcamp/pull/29","id":192343911,"number":29,"title":"Lesson4 improvement","user":{"login":"ElemarJR","id":105970,"avatar_url":"https://avatars.githubusercontent.com/u/105970?v=3","gravatar_id":"","url":"https://api.github.com/users/ElemarJR","html_url":"https://github.com/ElemarJR","followers_url":"https://api.github.com/users/ElemarJR/followers","following_url":"https://api.github.com/users/ElemarJR/following{/other_user}","gists_url":"https://api.github.com/users/ElemarJR/gists{/gist_id}","starred_url":"https://api.github.com/users/ElemarJR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElemarJR/subscriptions","organizations_url":"https://api.github.com/users/ElemarJR/orgs","repos_url":"https://api.github.com/users/ElemarJR/repos","events_url":"https://api.github.com/users/ElemarJR/events{/privacy}","received_events_url":"https://api.github.com/users/ElemarJR/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-11-29T17:15:33Z","updated_at":"2016-11-30T13:25:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ravendb/bootcamp/pulls/29","html_url":"https://github.com/ravendb/bootcamp/pull/29","diff_url":"https://github.com/ravendb/bootcamp/pull/29.diff","patch_url":"https://github.com/ravendb/bootcamp/pull/29.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/ravendb/bootcamp/issues/comments/263872573","html_url":"https://github.com/ravendb/bootcamp/pull/29#issuecomment-263872573","issue_url":"https://api.github.com/repos/ravendb/bootcamp/issues/29","id":263872573,"user":{"login":"ElemarJR","id":105970,"avatar_url":"https://avatars.githubusercontent.com/u/105970?v=3","gravatar_id":"","url":"https://api.github.com/users/ElemarJR","html_url":"https://github.com/ElemarJR","followers_url":"https://api.github.com/users/ElemarJR/followers","following_url":"https://api.github.com/users/ElemarJR/following{/other_user}","gists_url":"https://api.github.com/users/ElemarJR/gists{/gist_id}","starred_url":"https://api.github.com/users/ElemarJR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ElemarJR/subscriptions","organizations_url":"https://api.github.com/users/ElemarJR/orgs","repos_url":"https://api.github.com/users/ElemarJR/repos","events_url":"https://api.github.com/users/ElemarJR/events{/privacy}","received_events_url":"https://api.github.com/users/ElemarJR/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T13:25:44Z","updated_at":"2016-11-30T13:25:44Z","body":"The notification event will be fired before I have change to get the new\nEtag. :)\n\nMy idea was to have some flag before saving...\n\nEm qua, 30 de nov de 2016 às 09:21, Arkadiusz Paliński <\nnotifications@github.com> escreveu:\n\n> Not sure what do you mean. Once you successfully updated a doc you are\n> guaranteed that it was saved with etag you got in the response which is\n> going to be returned as the result of GetEtagFor call since the doc was\n> updated within this session.\n>\n> On Wed, Nov 30, 2016 at 12:08 PM Elemar Rodrigues Severo Junior <\n> notifications@github.com> wrote:\n>\n> > Would be that enough, including concurrent scenarios?\n> > Em qua, 30 de nov de 2016 às 09:03, Arkadiusz Paliński <\n> > notifications@github.com> escreveu:\n> >\n> > > Just compare that the etag has changed since we modified it. Use\n> > > `_session.Advanced.GetEtagFor(_category)`\n> > > after you save it and check if it's different than change.Etag (Etag\n> > class\n> > > has != operator defined)\n> > >\n> > > On Wed, Nov 30, 2016 at 11:09 AM Elemar Rodrigues Severo Junior <\n> > > notifications@github.com> wrote:\n> > >\n> > > > Is there some recommendation of what to do? What should be the\n> approach\n> > > > here?\n> > > >\n> > > > Em qua, 30 de nov de 2016 às 05:30, Arkadiusz Paliński <\n> > > > notifications@github.com> escreveu:\n> > > >\n> > > > > *@arekpalinski* commented on this pull request.\n> > > > > ------------------------------\n> > > > >\n> > > > > In\n> > src/Unit-3/lesson4/CollaborativeCategoryEditing/EditCategoryForm.cs\n> > > > > <https://github.com/ravendb/bootcamp/pull/29>:\n> > > > >\n> > > > > > + _localEtag = _session.Advanced.GetEtagFor(_category);\n> > > > > + _subscription = DocumentStoreHolder.Store\n> > > > > + .Changes()\n> > > > > + .ForDocument(CategoryIdTextbox.Text)\n> > > > > + .Where(DocumentChangedByOtherUser)\n> > > > > + .Subscribe(DocumentChangedOnServer);\n> > > > > +\n> > > > > + ToggleEditing();\n> > > > > + }\n> > > > > + }\n> > > > > +\n> > > > > + private bool\n> DocumentChangedByOtherUser(DocumentChangeNotification\n> > > > change)\n> > > > > + {\n> > > > > + if (_savesCount == 0) return true;\n> > > > > +\n> > > > > + var numberOfServerChanges = change.Etag.Changes -\n> > _localEtag.Changes;\n> > > > >\n> > > > > Once we loose the connection we try to renew it then so the client\n> > will\n> > > > be\n> > > > > notified even after the restart.\n> > > > >\n> > > > > —\n> > > > > You are receiving this because you authored the thread.\n> > > > > Reply to this email directly, view it on GitHub\n> > > > > <https://github.com/ravendb/bootcamp/pull/29>, or mute the thread\n> > > > > <\n> > > >\n> > >\n> >\n> https://github.com/notifications/unsubscribe-auth/AAGd8kJPs5RApZY9dssADnPaUXc3pL4Tks5rDSYpgaJpZM4K_PSq\n> > > > >\n> > > > > .\n> > > > >\n> > > >\n> > > > —\n> > > > You are receiving this because you were mentioned.\n> > > > Reply to this email directly, view it on GitHub\n> > > > <https://github.com/ravendb/bootcamp/pull/29#issuecomment-263834202\n> >,\n> > > or mute\n> > > > the thread\n> > > > <\n> > >\n> >\n> https://github.com/notifications/unsubscribe-auth/AAW-52Lv4l16swv7xdgrR221agymCyEpks5rDUtpgaJpZM4K_PSq\n> > > >\n> > > > .\n> > > >\n> > >\n> > > —\n> > > You are receiving this because you authored the thread.\n> > > Reply to this email directly, view it on GitHub\n> > > <https://github.com/ravendb/bootcamp/pull/29#issuecomment-263846100>,\n> > or mute\n> > > the thread\n> > > <\n> >\n> https://github.com/notifications/unsubscribe-auth/AAGd8hHpXMlzooY6opQWbFIGDyO3OkqOks5rDVgOgaJpZM4K_PSq\n> > >\n> > > .\n> > >\n> >\n> > —\n> > You are receiving this because you were mentioned.\n> > Reply to this email directly, view it on GitHub\n> > <https://github.com/ravendb/bootcamp/pull/29#issuecomment-263847038>,\n> or mute\n> > the thread\n> > <\n> https://github.com/notifications/unsubscribe-auth/AAW-50AXU3RIArZmvu_RlcOOfMGMDrUZks5rDVk6gaJpZM4K_PSq\n> >\n> > .\n> >\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/ravendb/bootcamp/pull/29#issuecomment-263849561>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/AAGd8qI9YxeLkkuq4dUrOPIhTZK73WYNks5rDVwygaJpZM4K_PSq>\n> .\n>\n"}}
{"actor":{"display_login":"ElemarJR"}}