{"action":"created","issue":{"url":"https://api.github.com/repos/almende/vis/issues/577","labels_url":"https://api.github.com/repos/almende/vis/issues/577/labels{/name}","comments_url":"https://api.github.com/repos/almende/vis/issues/577/comments","events_url":"https://api.github.com/repos/almende/vis/issues/577/events","html_url":"https://github.com/almende/vis/issues/577","id":54633570,"number":577,"title":"Duplicate timeline events are fired for single user actions","user":{"login":"brichbe","id":6853735,"avatar_url":"https://avatars.githubusercontent.com/u/6853735?v=3","gravatar_id":"","url":"https://api.github.com/users/brichbe","html_url":"https://github.com/brichbe","followers_url":"https://api.github.com/users/brichbe/followers","following_url":"https://api.github.com/users/brichbe/following{/other_user}","gists_url":"https://api.github.com/users/brichbe/gists{/gist_id}","starred_url":"https://api.github.com/users/brichbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brichbe/subscriptions","organizations_url":"https://api.github.com/users/brichbe/orgs","repos_url":"https://api.github.com/users/brichbe/repos","events_url":"https://api.github.com/users/brichbe/events{/privacy}","received_events_url":"https://api.github.com/users/brichbe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/almende/vis/labels/Timeline","name":"Timeline","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-01-16T22:35:10Z","updated_at":"2015-03-10T14:19:25Z","closed_at":null,"body":"Duplicate back-to-back onAdd/onUpdate/onRemove function callbacks are occurring when creating/editing/deleting timeline items.\r\n\r\nCurrently using version 3.9.0 -- it seems this issue was introduced recently.\r\n\r\nReproduce issue by using the 'Edit items' example at:  http://visjs.org/examples/timeline/08_edit_items.html\r\n\r\nDouble-click empty space, or double-click an existing item, or select and choose to delete an existing item.  In all these cases, the subsequent prompt dialogs are unexpectedly repeated."},"comment":{"url":"https://api.github.com/repos/almende/vis/issues/comments/78062188","html_url":"https://github.com/almende/vis/issues/577#issuecomment-78062188","issue_url":"https://api.github.com/repos/almende/vis/issues/577","id":78062188,"user":{"login":"brichbe","id":6853735,"avatar_url":"https://avatars.githubusercontent.com/u/6853735?v=3","gravatar_id":"","url":"https://api.github.com/users/brichbe","html_url":"https://github.com/brichbe","followers_url":"https://api.github.com/users/brichbe/followers","following_url":"https://api.github.com/users/brichbe/following{/other_user}","gists_url":"https://api.github.com/users/brichbe/gists{/gist_id}","starred_url":"https://api.github.com/users/brichbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brichbe/subscriptions","organizations_url":"https://api.github.com/users/brichbe/orgs","repos_url":"https://api.github.com/users/brichbe/repos","events_url":"https://api.github.com/users/brichbe/events{/privacy}","received_events_url":"https://api.github.com/users/brichbe/received_events","type":"User","site_admin":false},"created_at":"2015-03-10T14:19:24Z","updated_at":"2015-03-10T14:19:24Z","body":"I haven't tried your latest change in the develop branch, but I was able to reproduce this issue again using 3.11.0.  It is still very sporadic and cannot be reproduced consistently -- it seems to happen at random.  I opened the visjs.org edit_items example in IE11 and clicked around adding/editing/deleting items for a couple minutes before I received a double prompt on deleting an item.\r\n\r\nStopping event propagation before callback functions seems logical and will hopefully fix this entirely, but it'll be a couple days til I can try testing that.\r\n\r\nDo those images I previously posted of the call stacks give you any indication of the root cause?  When I glanced over those areas of the vis code a few weeks ago, I had a feeling this double prompt was potentially caused by extra events originating from hammer, but I don't know enough about hammer and your event processing algorithms to prove that.  The fact that, in the buggy case, `onTouchHandler` was executed immediately after the first `confirm` prompt is what lead me to that theory.  Since the confirm obviously doesn't generate a select/touch event, that call sequence implies whatever code generated the first event that invoked `onTouchHandler`, that same code must have generated a second \"duplicate\" event.  So if hammer or something else is causing duplicate events to occasionally be fired, I'm not sure if preemptively stopping the propagation of the first event will affect the propagation of the \"duplicate\" second event."}}