GitHub PullRequestReviewCommentEvent at 2014-01-23 08:14:58
Repository: gaia
Actor: crdlc
Payload: {"comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/9105434","id":9105434,"diff_hunk":"@@ -110,25 +110,21 @@ var fb = window.fb || {};\n     }\n \n     function doSave(obj, outRequest) {\n-      if (obj.uid in index().byUid) {\n-        outRequest.failed({\n-          name: contacts.ALREADY_EXISTS\n-        });\n-        return;\n-      }\n-\n-      var globalId;\n       LazyLoader.load([TEL_INDEXER_JS, PHONE_MATCHER_JS] , function() {\n-        datastore().add(obj).then(function success(newId) {\n-          globalId = newId;\n-          var uid = obj.uid;\n-          index().byUid[uid] = newId;\n-          indexByPhone(obj, newId);\n-\n-          return datastore().put(index(), INDEX_ID);\n-        }, defaultError(outRequest)).then(function success() {\n-          defaultSuccessCb(outRequest, globalId);\n-        }, defaultError(outRequest));\n+        datastore().add(obj, obj.uid).then(function success(newId) {\n+          indexByPhone(obj, obj.uid);\n+          isIndexDirty = true;\n+          outRequest.done();\n+        }, function error(err) {\n+            // TODO: Check this code one Bug 962516 lands\n+            if (err.name === 'ConstraintError') {\n+               outRequest.failed({\n+                name: contacts.ALREADY_EXISTS\n+              });\n+              return;","path":"apps/communications/contacts/js/fb/fb_data.js","position":33,"original_position":33,"commit_id":"a36507611c8f9f864f4d081b302681544caa052e","original_commit_id":"a36507611c8f9f864f4d081b302681544caa052e","user":{"login":"crdlc","id":1722741,"avatar_url":"https://gravatar.com/avatar/543212083e575559480c086cc3bc436d?d=https%3A%2F%2Fidenticons.github.com%2F31914edefc008e54d9714eb37cf8d514.png&r=x","gravatar_id":"543212083e575559480c086cc3bc436d","url":"https://api.github.com/users/crdlc","html_url":"https://github.com/crdlc","followers_url":"https://api.github.com/users/crdlc/followers","following_url":"https://api.github.com/users/crdlc/following{/other_user}","gists_url":"https://api.github.com/users/crdlc/gists{/gist_id}","starred_url":"https://api.github.com/users/crdlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crdlc/subscriptions","organizations_url":"https://api.github.com/users/crdlc/orgs","repos_url":"https://api.github.com/users/crdlc/repos","events_url":"https://api.github.com/users/crdlc/events{/privacy}","received_events_url":"https://api.github.com/users/crdlc/received_events","type":"User","site_admin":false},"body":"is not cleared to remove this return and to add an else statement?","created_at":"2014-01-23T08:14:58Z","updated_at":"2014-01-23T08:14:58Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/15599#discussion_r9105434","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/15599","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/9105434"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/15599#discussion_r9105434"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/15599"}}}}