{"action":"created","issue":{"url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/issues/1556","repository_url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior","labels_url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/issues/1556/labels{/name}","comments_url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/issues/1556/comments","events_url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/issues/1556/events","html_url":"https://github.com/GothenburgBitFactory/taskwarrior/issues/1556","id":297056524,"number":1556,"title":"[TW-1530] Multiple on-add hooks generating new tasks are ignored","user":{"login":"taskwarrior","id":146045,"avatar_url":"https://avatars0.githubusercontent.com/u/146045?v=4","gravatar_id":"","url":"https://api.github.com/users/taskwarrior","html_url":"https://github.com/taskwarrior","followers_url":"https://api.github.com/users/taskwarrior/followers","following_url":"https://api.github.com/users/taskwarrior/following{/other_user}","gists_url":"https://api.github.com/users/taskwarrior/gists{/gist_id}","starred_url":"https://api.github.com/users/taskwarrior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskwarrior/subscriptions","organizations_url":"https://api.github.com/users/taskwarrior/orgs","repos_url":"https://api.github.com/users/taskwarrior/repos","events_url":"https://api.github.com/users/taskwarrior/events{/privacy}","received_events_url":"https://api.github.com/users/taskwarrior/received_events","type":"User","site_admin":false},"labels":[{"id":825679217,"url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/labels/bug","name":"bug","color":"d73a4a","default":true},{"id":834573594,"url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/labels/won't%20fix","name":"won't fix","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/milestones/19","html_url":"https://github.com/GothenburgBitFactory/taskwarrior/milestone/19","labels_url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/milestones/19/labels","id":3107839,"number":19,"title":"2.4.1","description":null,"creator":{"login":"taskwarrior","id":146045,"avatar_url":"https://avatars0.githubusercontent.com/u/146045?v=4","gravatar_id":"","url":"https://api.github.com/users/taskwarrior","html_url":"https://github.com/taskwarrior","followers_url":"https://api.github.com/users/taskwarrior/followers","following_url":"https://api.github.com/users/taskwarrior/following{/other_user}","gists_url":"https://api.github.com/users/taskwarrior/gists{/gist_id}","starred_url":"https://api.github.com/users/taskwarrior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskwarrior/subscriptions","organizations_url":"https://api.github.com/users/taskwarrior/orgs","repos_url":"https://api.github.com/users/taskwarrior/repos","events_url":"https://api.github.com/users/taskwarrior/events{/privacy}","received_events_url":"https://api.github.com/users/taskwarrior/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":21,"state":"open","created_at":"2018-02-12T14:07:19Z","updated_at":"2018-02-14T11:09:57Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-02-14T11:09:41Z","updated_at":"2018-02-14T11:10:27Z","closed_at":"2018-02-14T11:09:56Z","author_association":"CONTRIBUTOR","body":"_Tomas Babej on 2015-01-31T01:04:29Z says:_ \n\n If two on-add hooks add additional tasks in the same on-add event, only the tasks generated by the last one are added.\n\nThis is due to the fact that:\n{code}\ninput.clear ();\n{code}\n\nis called inside the loop that processes the on-add matching scripts.\n\nExample run:\n```\n$ task rc.debug.hooks=2 add ratata                                                                                                                                               \nTimer Config::load (/usr/local/share/doc/task/rc/solarized-dark-256.theme) 0.000183 sec\nTimer Config::load (/home/tbabej/.taskrc) 0.001404 sec\nFound hook script /home/tbabej/.task/hooks/on-add-test1\nFound hook script /home/tbabej/.task/hooks/on-add-test2\nFound hook script /home/tbabej/.task/hooks/on-modify-test\nTask::modify\n  MODIFICATION description <-- 'ratata'\nHooks: Calling /home/tbabej/.task/hooks/on-add-test1\nHooks: input\n  {\"description\":\"ratata\",\"entry\":\"20150131T010043Z\",\"modified\":\"20150131T010043Z\",\"project\":\"Inbox\",\"status\":\"pending\",\"uuid\":\"0d4267ff-1d14-48d7-8f7b-3b14999faa62\"}\nTimer Hooks::execute (/home/tbabej/.task/hooks/on-add-test1) 0.173436 sec\nHooks: output\n  {\"status\":\"pending\",\"uuid\":\"0d4267ff-1d14-48d7-8f7b-3b14999faa62\",\"modified\":\"20150131T010043Z\",\"project\":\"Inbox\",\"entry\":\"20150131T010043Z\",\"description\":\"ratata\"}\n  {\"description\":\"test1\",\"entry\":\"20150130T233041Z\",\"modified\":\"20150130T233041Z\",\"project\":\"Inbox\",\"status\":\"pending\",\"urgency\":1}\nHooks: Completed with status 0\n \nHooks: Calling /home/tbabej/.task/hooks/on-add-test2\nHooks: input\n  {\"status\":\"pending\",\"uuid\":\"0d4267ff-1d14-48d7-8f7b-3b14999faa62\",\"modified\":\"20150131T010043Z\",\"project\":\"Inbox\",\"entry\":\"20150131T010043Z\",\"description\":\"ratata\"}\n  {\"description\":\"test1\",\"entry\":\"20150130T233041Z\",\"modified\":\"20150130T233041Z\",\"project\":\"Inbox\",\"status\":\"pending\",\"urgency\":1}\nTimer Hooks::execute (/home/tbabej/.task/hooks/on-add-test2) 0.165489 sec\nHooks: output\n  {\"status\":\"pending\",\"description\":\"ratata\",\"modified\":\"20150131T010043Z\",\"project\":\"Inbox\",\"entry\":\"20150131T010043Z\",\"uuid\":\"0d4267ff-1d14-48d7-8f7b-3b14999faa62\"}\n  {\"description\":\"test2\",\"entry\":\"20150130T233041Z\",\"modified\":\"20150130T233041Z\",\"project\":\"INBOXX\",\"status\":\"pending\",\"urgency\":1}\nHooks: Completed with status 0\n \n  pending.data rw O T0002+002~000 L0000+000\ncompleted.data rw - T0000+000~000 L0000+000\n     undo.data rw O T0000+000~000 L0006+006\n  backlog.data rw O T0000+000~000 L0002+002\n \nPerf task 2.4.1 77ec56d 20150131T010043Z init:3685 load:110 gc:0 filter:0 commit:133 sort:0 render:0 hooks:339441 total:343369\n\nCreated task 1.\nConfiguration override rc.debug.hooks:2\nThe project 'Inbox' has changed.  Project 'Inbox' is 0% complete (1 task remaining).\n\n$ task\n[task next]\n\n ID Age Project Recur Description Urg \n  1 17s Inbox         ratata         1\n  2 1h  INBOXX        test2          1\n\n2 tasks\nThere are local changes.  Sync required.\n\n```\n\nWe can see that only test2 was added where as test1 should have been added as well."},"comment":{"url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/issues/comments/365571117","html_url":"https://github.com/GothenburgBitFactory/taskwarrior/issues/1556#issuecomment-365571117","issue_url":"https://api.github.com/repos/GothenburgBitFactory/taskwarrior/issues/1556","id":365571117,"user":{"login":"taskwarrior","id":146045,"avatar_url":"https://avatars0.githubusercontent.com/u/146045?v=4","gravatar_id":"","url":"https://api.github.com/users/taskwarrior","html_url":"https://github.com/taskwarrior","followers_url":"https://api.github.com/users/taskwarrior/followers","following_url":"https://api.github.com/users/taskwarrior/following{/other_user}","gists_url":"https://api.github.com/users/taskwarrior/gists{/gist_id}","starred_url":"https://api.github.com/users/taskwarrior/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taskwarrior/subscriptions","organizations_url":"https://api.github.com/users/taskwarrior/orgs","repos_url":"https://api.github.com/users/taskwarrior/repos","events_url":"https://api.github.com/users/taskwarrior/events{/privacy}","received_events_url":"https://api.github.com/users/taskwarrior/received_events","type":"User","site_admin":false},"created_at":"2018-02-14T11:10:27Z","updated_at":"2018-02-14T11:10:27Z","author_association":"CONTRIBUTOR","body":"_Tomas Babej on 2015-01-31T13:53:26Z says:_ \n\n I have been thinking more about this and I suppose this is not a valid bug.\n\nHook1 - input: original task, output: two tasks (intended as \"take the user added task and output it, and add one new task\")\nHook2 - input: (reads only one line), output: two tasks (intended as \"take the user added task and output it, and add one new task\")\n\nThe problem here is that Hook2 should have read two tasks and outputted three. TW has however, only limited ways to discover this problem, since it does not know whether the output of Hook2 is not \"the user added task + modified version of the task added by the Hook1\"."}}
{"actor":{"display_login":"taskwarrior"}}