{"action":"closed","issue":{"url":"https://api.github.com/repos/goldmansachs/reladomo/issues/149","repository_url":"https://api.github.com/repos/goldmansachs/reladomo","labels_url":"https://api.github.com/repos/goldmansachs/reladomo/issues/149/labels{/name}","comments_url":"https://api.github.com/repos/goldmansachs/reladomo/issues/149/comments","events_url":"https://api.github.com/repos/goldmansachs/reladomo/issues/149/events","html_url":"https://github.com/goldmansachs/reladomo/issues/149","id":319747248,"number":149,"title":"MultiUpdateOperation.combineMultiUpdate incorrectly combines increment on double","user":{"login":"neistadt","id":35015896,"avatar_url":"https://avatars2.githubusercontent.com/u/35015896?v=4","gravatar_id":"","url":"https://api.github.com/users/neistadt","html_url":"https://github.com/neistadt","followers_url":"https://api.github.com/users/neistadt/followers","following_url":"https://api.github.com/users/neistadt/following{/other_user}","gists_url":"https://api.github.com/users/neistadt/gists{/gist_id}","starred_url":"https://api.github.com/users/neistadt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neistadt/subscriptions","organizations_url":"https://api.github.com/users/neistadt/orgs","repos_url":"https://api.github.com/users/neistadt/repos","events_url":"https://api.github.com/users/neistadt/events{/privacy}","received_events_url":"https://api.github.com/users/neistadt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-02T23:39:36Z","updated_at":"2018-05-18T00:06:50Z","closed_at":"2018-05-18T00:06:50Z","author_association":"NONE","body":"When MultiUpdateOperation tries to combine with another MultiUpdateOperation, the combineOnSameAttribute call incorrectly merges increment on double operations across objects with different primary keys. The setup for this is as follows:\r\n\r\nAssume a primary key of Account + Product and a Quantity balance. If you have 6 increment operations as follows:\r\n\r\nupdate1. Account 1, Product 1, increment 100\r\nupdate2. Account 1, Product 2, increment 100\r\nupdate3. Account 2, Product 3, increment 100\r\nupdate4. Account 2, Product 4, increment 100\r\nupdate5. Account 1, Product 5, increment 100\r\nupdate6. Account 1, Product 6, increment 100\r\n\r\nupdate1 & 2 will be combined into a MultiUpdateOperation A of:\r\nupdate Account 1 set quantity = quantity + 100 where product in (1, 2)\r\n\r\nupdate3 & 4 will be combined into a MultiUpdateOperation B of:\r\nupdate Account 2 set quantity = quantity + 100 where product in (3, 4)\r\n\r\nupdate5 & 6 will be combined into a MultiUpdateOperation C of:\r\nupdate Account 1 set quantity = quantity + 100 where product in (5, 6)\r\n\r\nNext, MultiUpdateOperation A and MultiUpdateOperation C will be combined incorrectly into:\r\nupdate Account 1 set quantity = quantity + 200 where product in (1, 2, 5, 6)\r\n\r\nI believe the combineForSameAttribute funciton in DoubleIncrementUpdateWrapper was only intended to combine increments for objects of the same primary key. But because its combining across different keys, its creating unexpected results."}}
{"actor":{"display_login":"mohrezaei"}}