{"action":"opened","issue":{"url":"https://api.github.com/repos/PyBossa/random-scheduler/issues/2","repository_url":"https://api.github.com/repos/PyBossa/random-scheduler","labels_url":"https://api.github.com/repos/PyBossa/random-scheduler/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/PyBossa/random-scheduler/issues/2/comments","events_url":"https://api.github.com/repos/PyBossa/random-scheduler/issues/2/events","html_url":"https://github.com/PyBossa/random-scheduler/issues/2","id":175071239,"number":2,"title":"pybossa.js assumes stable order","user":{"login":"jtbates","id":609080,"avatar_url":"https://avatars.githubusercontent.com/u/609080?v=3","gravatar_id":"","url":"https://api.github.com/users/jtbates","html_url":"https://github.com/jtbates","followers_url":"https://api.github.com/users/jtbates/followers","following_url":"https://api.github.com/users/jtbates/following{/other_user}","gists_url":"https://api.github.com/users/jtbates/gists{/gist_id}","starred_url":"https://api.github.com/users/jtbates/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtbates/subscriptions","organizations_url":"https://api.github.com/users/jtbates/orgs","repos_url":"https://api.github.com/users/jtbates/repos","events_url":"https://api.github.com/users/jtbates/events{/privacy}","received_events_url":"https://api.github.com/users/jtbates/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-05T13:25:23Z","updated_at":"2016-09-05T13:25:23Z","closed_at":null,"body":"While the user is working on a task, pybossa.js loads the next task using the offset parameter. After the user completes the task and the task run is submitted, pybossa.js assumes that the task it retrieved previously at offset=1 is now at offset=0 and that newtask?offset=1 will return a different task. If Issue #1 is fixed but the scheduler still violates this assumption, there can be an error where the task presenter tells the user that they have completed all tasks while there is still one left.\r\n\r\nHere is what could happen:\r\n\r\n1. There are three candidate tasks that the user has not completed: `x y z`.\r\n2. The task presenter retrieves task `x` at offset=0 and `y` at offset=1.\r\n3. The user completes task `x` and the task run is submitted.\r\n4. There are now two candidate tasks left: `y z`.\r\n5. The user is presented the preloaded task `y`.\r\n6. Another request is made to newtask?offset=1 and the response is again `y`.\r\n7. pybossa.js recognizes that this is the same tasks that is now presented and requests newtask?offset=2. The response is empty as there are only two candidate tasks left.\r\n8. The user completes task `y`. The next preloaded task is empty and the task presenter tells the user that they have completed all tasks."}}
{"actor":{"display_login":"jtbates"}}