{"action":"opened","issue":{"url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/5070","repository_url":"https://api.github.com/repos/ankidroid/Anki-Android","labels_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/5070/labels{/name}","comments_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/5070/comments","events_url":"https://api.github.com/repos/ankidroid/Anki-Android/issues/5070/events","html_url":"https://github.com/ankidroid/Anki-Android/issues/5070","id":372220877,"node_id":"MDU6SXNzdWUzNzIyMjA4Nzc=","number":5070,"title":"Graves table almost never cleared, leads to database bloat","user":{"login":"mikehardy","id":782704,"node_id":"MDQ6VXNlcjc4MjcwNA==","avatar_url":"https://avatars1.githubusercontent.com/u/782704?v=4","gravatar_id":"","url":"https://api.github.com/users/mikehardy","html_url":"https://github.com/mikehardy","followers_url":"https://api.github.com/users/mikehardy/followers","following_url":"https://api.github.com/users/mikehardy/following{/other_user}","gists_url":"https://api.github.com/users/mikehardy/gists{/gist_id}","starred_url":"https://api.github.com/users/mikehardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikehardy/subscriptions","organizations_url":"https://api.github.com/users/mikehardy/orgs","repos_url":"https://api.github.com/users/mikehardy/repos","events_url":"https://api.github.com/users/mikehardy/events{/privacy}","received_events_url":"https://api.github.com/users/mikehardy/received_events","type":"User","site_admin":false},"labels":[{"id":241408962,"node_id":"MDU6TGFiZWwyNDE0MDg5NjI=","url":"https://api.github.com/repos/ankidroid/Anki-Android/labels/enhancement","name":"enhancement","color":"207de5","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-20T15:09:49Z","updated_at":"2018-10-20T15:09:49Z","closed_at":null,"author_association":"MEMBER","body":"###### Reproduction Steps\r\n\r\n1. Import a very large collection on an emulator that is not associated with ankiweb\r\n2. Delete the collection so there are no cards and check database / check media\r\n3. Check the size of the database\r\n\r\n\r\n###### Expected Result\r\n\r\nDatabase is tiny, a few kilobytes\r\n\r\n###### Actual Result\r\n\r\nDatabase is still large (from my test, 20MB, exhausting the space on my emulator with backups and such...)\r\n\r\n\r\nWhat's happening is that we are vacuuming correctly, but the only place the \"graves\" table is cleared that I can see is in \"Collection.beforeUpload()\" (called from FullSyncer on full upload)\r\n\r\nI checked the anki python code and it appears that on normal sync, the graves table is synchronized but never deleted from? So I'm not sure there's any mechanism to ever clear this table.\r\n\r\nIs that intended?\r\n\r\nSeems that if there is no synchronization we could at least offer a mechanism to clear graves. Its possible this would be okay by default but we would need to take care on the interaction with an imported collection that was then modified with card deletes and then attached to an account and synchronized."}}
{"actor":{"display_login":"mikehardy"}}