{"action":"closed","number":259,"pull_request":{"url":"https://api.github.com/repos/projectbuendia/client/pulls/259","id":57873526,"html_url":"https://github.com/projectbuendia/client/pull/259","diff_url":"https://github.com/projectbuendia/client/pull/259.diff","patch_url":"https://github.com/projectbuendia/client/pull/259.patch","issue_url":"https://api.github.com/repos/projectbuendia/client/issues/259","number":259,"state":"closed","locked":false,"title":"Fixes #177: \"Sorry, form save failed: Index 0 requested...\"","user":{"login":"capnfabs","id":1336508,"avatar_url":"https://avatars.githubusercontent.com/u/1336508?v=3","gravatar_id":"","url":"https://api.github.com/users/capnfabs","html_url":"https://github.com/capnfabs","followers_url":"https://api.github.com/users/capnfabs/followers","following_url":"https://api.github.com/users/capnfabs/following{/other_user}","gists_url":"https://api.github.com/users/capnfabs/gists{/gist_id}","starred_url":"https://api.github.com/users/capnfabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capnfabs/subscriptions","organizations_url":"https://api.github.com/users/capnfabs/orgs","repos_url":"https://api.github.com/users/capnfabs/repos","events_url":"https://api.github.com/users/capnfabs/events{/privacy}","received_events_url":"https://api.github.com/users/capnfabs/received_events","type":"User","site_admin":false},"body":"ODK keys its form type data off of an `_ID` column, which is a primary key on the `forms` table.\r\nThis `_ID`, however, isn't explicitly set anywhere - it's an auto-incrementing primary key.\r\n\r\nWhen a sync occurred whilst a form was being filled out, the form was being replaced in the ODK\r\ndatabase. ODK's FormsProvider, however, models REPLACE operations as DELETEs followed by INSERTs in\r\na single transaction. This meant that that the `_ID` column changed for every form on every sync,\r\nwhich means that when ODK goes to look up the form information again on submit, the relevant form\r\nhad disappeared.\r\n\r\nThis change fixes the problem by figuring out the `_ID` of the existing record, and then doing an\r\n`INSERT OR REPLACE` instead of the transactional `DELETE` and `INSERT`.\r\n\r\nA better long-term fix might be to make the ODK keep the form information in memory whilst the form\r\nwas being filled out, but that's fiddlier.","created_at":"2016-02-01T17:41:07Z","updated_at":"2016-02-01T17:46:47Z","closed_at":"2016-02-01T17:46:47Z","merged_at":"2016-02-01T17:46:47Z","merge_commit_sha":"407a3ad2b71bd753576c3bfda6806fd25ca4d905","assignee":{"login":"llvasconcellos","id":1710823,"avatar_url":"https://avatars.githubusercontent.com/u/1710823?v=3","gravatar_id":"","url":"https://api.github.com/users/llvasconcellos","html_url":"https://github.com/llvasconcellos","followers_url":"https://api.github.com/users/llvasconcellos/followers","following_url":"https://api.github.com/users/llvasconcellos/following{/other_user}","gists_url":"https://api.github.com/users/llvasconcellos/gists{/gist_id}","starred_url":"https://api.github.com/users/llvasconcellos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llvasconcellos/subscriptions","organizations_url":"https://api.github.com/users/llvasconcellos/orgs","repos_url":"https://api.github.com/users/llvasconcellos/repos","events_url":"https://api.github.com/users/llvasconcellos/events{/privacy}","received_events_url":"https://api.github.com/users/llvasconcellos/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/projectbuendia/client/pulls/259/commits","review_comments_url":"https://api.github.com/repos/projectbuendia/client/pulls/259/comments","review_comment_url":"https://api.github.com/repos/projectbuendia/client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/projectbuendia/client/issues/259/comments","statuses_url":"https://api.github.com/repos/projectbuendia/client/statuses/2071a6d8542f296cfb293d6efc214e086a2c85ec","head":{"label":"capnfabs:fix/177","ref":"fix/177","sha":"2071a6d8542f296cfb293d6efc214e086a2c85ec","user":{"login":"capnfabs","id":1336508,"avatar_url":"https://avatars.githubusercontent.com/u/1336508?v=3","gravatar_id":"","url":"https://api.github.com/users/capnfabs","html_url":"https://github.com/capnfabs","followers_url":"https://api.github.com/users/capnfabs/followers","following_url":"https://api.github.com/users/capnfabs/following{/other_user}","gists_url":"https://api.github.com/users/capnfabs/gists{/gist_id}","starred_url":"https://api.github.com/users/capnfabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capnfabs/subscriptions","organizations_url":"https://api.github.com/users/capnfabs/orgs","repos_url":"https://api.github.com/users/capnfabs/repos","events_url":"https://api.github.com/users/capnfabs/events{/privacy}","received_events_url":"https://api.github.com/users/capnfabs/received_events","type":"User","site_admin":false},"repo":{"id":45015759,"name":"buendia-client","full_name":"capnfabs/buendia-client","owner":{"login":"capnfabs","id":1336508,"avatar_url":"https://avatars.githubusercontent.com/u/1336508?v=3","gravatar_id":"","url":"https://api.github.com/users/capnfabs","html_url":"https://github.com/capnfabs","followers_url":"https://api.github.com/users/capnfabs/followers","following_url":"https://api.github.com/users/capnfabs/following{/other_user}","gists_url":"https://api.github.com/users/capnfabs/gists{/gist_id}","starred_url":"https://api.github.com/users/capnfabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capnfabs/subscriptions","organizations_url":"https://api.github.com/users/capnfabs/orgs","repos_url":"https://api.github.com/users/capnfabs/repos","events_url":"https://api.github.com/users/capnfabs/events{/privacy}","received_events_url":"https://api.github.com/users/capnfabs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/capnfabs/buendia-client","description":"Android client app","fork":true,"url":"https://api.github.com/repos/capnfabs/buendia-client","forks_url":"https://api.github.com/repos/capnfabs/buendia-client/forks","keys_url":"https://api.github.com/repos/capnfabs/buendia-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/capnfabs/buendia-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/capnfabs/buendia-client/teams","hooks_url":"https://api.github.com/repos/capnfabs/buendia-client/hooks","issue_events_url":"https://api.github.com/repos/capnfabs/buendia-client/issues/events{/number}","events_url":"https://api.github.com/repos/capnfabs/buendia-client/events","assignees_url":"https://api.github.com/repos/capnfabs/buendia-client/assignees{/user}","branches_url":"https://api.github.com/repos/capnfabs/buendia-client/branches{/branch}","tags_url":"https://api.github.com/repos/capnfabs/buendia-client/tags","blobs_url":"https://api.github.com/repos/capnfabs/buendia-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/capnfabs/buendia-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/capnfabs/buendia-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/capnfabs/buendia-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/capnfabs/buendia-client/statuses/{sha}","languages_url":"https://api.github.com/repos/capnfabs/buendia-client/languages","stargazers_url":"https://api.github.com/repos/capnfabs/buendia-client/stargazers","contributors_url":"https://api.github.com/repos/capnfabs/buendia-client/contributors","subscribers_url":"https://api.github.com/repos/capnfabs/buendia-client/subscribers","subscription_url":"https://api.github.com/repos/capnfabs/buendia-client/subscription","commits_url":"https://api.github.com/repos/capnfabs/buendia-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/capnfabs/buendia-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/capnfabs/buendia-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/capnfabs/buendia-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/capnfabs/buendia-client/contents/{+path}","compare_url":"https://api.github.com/repos/capnfabs/buendia-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/capnfabs/buendia-client/merges","archive_url":"https://api.github.com/repos/capnfabs/buendia-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/capnfabs/buendia-client/downloads","issues_url":"https://api.github.com/repos/capnfabs/buendia-client/issues{/number}","pulls_url":"https://api.github.com/repos/capnfabs/buendia-client/pulls{/number}","milestones_url":"https://api.github.com/repos/capnfabs/buendia-client/milestones{/number}","notifications_url":"https://api.github.com/repos/capnfabs/buendia-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/capnfabs/buendia-client/labels{/name}","releases_url":"https://api.github.com/repos/capnfabs/buendia-client/releases{/id}","deployments_url":"https://api.github.com/repos/capnfabs/buendia-client/deployments","created_at":"2015-10-27T03:54:30Z","updated_at":"2015-10-27T03:54:47Z","pushed_at":"2016-02-01T17:40:36Z","git_url":"git://github.com/capnfabs/buendia-client.git","ssh_url":"git@github.com:capnfabs/buendia-client.git","clone_url":"https://github.com/capnfabs/buendia-client.git","svn_url":"https://github.com/capnfabs/buendia-client","homepage":null,"size":6315,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"dev"}},"base":{"label":"projectbuendia:dev","ref":"dev","sha":"c96983fedbfcd3e3f24af43e7eb5e70729635aba","user":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"repo":{"id":33972326,"name":"client","full_name":"projectbuendia/client","owner":{"login":"projectbuendia","id":13339011,"avatar_url":"https://avatars.githubusercontent.com/u/13339011?v=3","gravatar_id":"","url":"https://api.github.com/users/projectbuendia","html_url":"https://github.com/projectbuendia","followers_url":"https://api.github.com/users/projectbuendia/followers","following_url":"https://api.github.com/users/projectbuendia/following{/other_user}","gists_url":"https://api.github.com/users/projectbuendia/gists{/gist_id}","starred_url":"https://api.github.com/users/projectbuendia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/projectbuendia/subscriptions","organizations_url":"https://api.github.com/users/projectbuendia/orgs","repos_url":"https://api.github.com/users/projectbuendia/repos","events_url":"https://api.github.com/users/projectbuendia/events{/privacy}","received_events_url":"https://api.github.com/users/projectbuendia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/projectbuendia/client","description":"Android client app","fork":false,"url":"https://api.github.com/repos/projectbuendia/client","forks_url":"https://api.github.com/repos/projectbuendia/client/forks","keys_url":"https://api.github.com/repos/projectbuendia/client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/projectbuendia/client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/projectbuendia/client/teams","hooks_url":"https://api.github.com/repos/projectbuendia/client/hooks","issue_events_url":"https://api.github.com/repos/projectbuendia/client/issues/events{/number}","events_url":"https://api.github.com/repos/projectbuendia/client/events","assignees_url":"https://api.github.com/repos/projectbuendia/client/assignees{/user}","branches_url":"https://api.github.com/repos/projectbuendia/client/branches{/branch}","tags_url":"https://api.github.com/repos/projectbuendia/client/tags","blobs_url":"https://api.github.com/repos/projectbuendia/client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/projectbuendia/client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/projectbuendia/client/git/refs{/sha}","trees_url":"https://api.github.com/repos/projectbuendia/client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/projectbuendia/client/statuses/{sha}","languages_url":"https://api.github.com/repos/projectbuendia/client/languages","stargazers_url":"https://api.github.com/repos/projectbuendia/client/stargazers","contributors_url":"https://api.github.com/repos/projectbuendia/client/contributors","subscribers_url":"https://api.github.com/repos/projectbuendia/client/subscribers","subscription_url":"https://api.github.com/repos/projectbuendia/client/subscription","commits_url":"https://api.github.com/repos/projectbuendia/client/commits{/sha}","git_commits_url":"https://api.github.com/repos/projectbuendia/client/git/commits{/sha}","comments_url":"https://api.github.com/repos/projectbuendia/client/comments{/number}","issue_comment_url":"https://api.github.com/repos/projectbuendia/client/issues/comments{/number}","contents_url":"https://api.github.com/repos/projectbuendia/client/contents/{+path}","compare_url":"https://api.github.com/repos/projectbuendia/client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/projectbuendia/client/merges","archive_url":"https://api.github.com/repos/projectbuendia/client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/projectbuendia/client/downloads","issues_url":"https://api.github.com/repos/projectbuendia/client/issues{/number}","pulls_url":"https://api.github.com/repos/projectbuendia/client/pulls{/number}","milestones_url":"https://api.github.com/repos/projectbuendia/client/milestones{/number}","notifications_url":"https://api.github.com/repos/projectbuendia/client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/projectbuendia/client/labels{/name}","releases_url":"https://api.github.com/repos/projectbuendia/client/releases{/id}","deployments_url":"https://api.github.com/repos/projectbuendia/client/deployments","created_at":"2015-04-15T04:01:52Z","updated_at":"2016-01-26T19:08:03Z","pushed_at":"2016-02-01T17:46:47Z","git_url":"git://github.com/projectbuendia/client.git","ssh_url":"git@github.com:projectbuendia/client.git","clone_url":"https://github.com/projectbuendia/client.git","svn_url":"https://github.com/projectbuendia/client","homepage":null,"size":6517,"stargazers_count":35,"watchers_count":35,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":44,"forks":26,"open_issues":44,"watchers":35,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/projectbuendia/client/pulls/259"},"html":{"href":"https://github.com/projectbuendia/client/pull/259"},"issue":{"href":"https://api.github.com/repos/projectbuendia/client/issues/259"},"comments":{"href":"https://api.github.com/repos/projectbuendia/client/issues/259/comments"},"review_comments":{"href":"https://api.github.com/repos/projectbuendia/client/pulls/259/comments"},"review_comment":{"href":"https://api.github.com/repos/projectbuendia/client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/projectbuendia/client/pulls/259/commits"},"statuses":{"href":"https://api.github.com/repos/projectbuendia/client/statuses/2071a6d8542f296cfb293d6efc214e086a2c85ec"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"capnfabs","id":1336508,"avatar_url":"https://avatars.githubusercontent.com/u/1336508?v=3","gravatar_id":"","url":"https://api.github.com/users/capnfabs","html_url":"https://github.com/capnfabs","followers_url":"https://api.github.com/users/capnfabs/followers","following_url":"https://api.github.com/users/capnfabs/following{/other_user}","gists_url":"https://api.github.com/users/capnfabs/gists{/gist_id}","starred_url":"https://api.github.com/users/capnfabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/capnfabs/subscriptions","organizations_url":"https://api.github.com/users/capnfabs/orgs","repos_url":"https://api.github.com/users/capnfabs/repos","events_url":"https://api.github.com/users/capnfabs/events{/privacy}","received_events_url":"https://api.github.com/users/capnfabs/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":29,"deletions":10,"changed_files":1}}