{"action":"created","issue":{"url":"https://api.github.com/repos/vspinu/zotelo/issues/28","repository_url":"https://api.github.com/repos/vspinu/zotelo","labels_url":"https://api.github.com/repos/vspinu/zotelo/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/vspinu/zotelo/issues/28/comments","events_url":"https://api.github.com/repos/vspinu/zotelo/issues/28/events","html_url":"https://github.com/vspinu/zotelo/issues/28","id":142310809,"number":28,"title":"Wrong Zotero collection IDs on different computers.","user":{"login":"a-fent","id":12329153,"avatar_url":"https://avatars.githubusercontent.com/u/12329153?v=3","gravatar_id":"","url":"https://api.github.com/users/a-fent","html_url":"https://github.com/a-fent","followers_url":"https://api.github.com/users/a-fent/followers","following_url":"https://api.github.com/users/a-fent/following{/other_user}","gists_url":"https://api.github.com/users/a-fent/gists{/gist_id}","starred_url":"https://api.github.com/users/a-fent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a-fent/subscriptions","organizations_url":"https://api.github.com/users/a-fent/orgs","repos_url":"https://api.github.com/users/a-fent/repos","events_url":"https://api.github.com/users/a-fent/events{/privacy}","received_events_url":"https://api.github.com/users/a-fent/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-21T10:39:37Z","updated_at":"2016-03-30T08:54:42Z","closed_at":null,"body":"I am working with the same set of files and same Zotero database (synced by Zotero sync) across two different computers. I set the Zotero collection on one machine and all works well with update - this is a great library, thanks.\r\n\r\nWhen I move to the other machine (the org files are kept in sync with Unison), C-u z u seems to work, but exports the wrong collection to my .bib file. Looking at the output of zotelo-set-collection with zotelo-verbose, this is because the ID numbers given to each collection are different on the two machines. The same collections, just different 1-2 digit IDs.\r\n\r\nThese IDs are drawn directly from the database (see https://github.com/zotero/zotero/blob/4dd56eadfca9b89e1728661776407337bb823ebd/chrome/content/zotero/xpcom/data_access.js#L43) but since they are simply insertion-order it seems they are not guaranteed to be stable across different synced instances of the database. Looking at the zotero.sqlite on the two computers they are indeed different.\r\n\r\nThis is basically a problem, I think, with Zotero.getCollections(), which should return the \"key\" field not the \"id\" field to identify collections uniquely and stably. In the meantime, however, it would fix the bug in zotelo not to rely on the collection ID to store the connected collection, but simply to save the name/path."},"comment":{"url":"https://api.github.com/repos/vspinu/zotelo/issues/comments/203329556","html_url":"https://github.com/vspinu/zotelo/issues/28#issuecomment-203329556","issue_url":"https://api.github.com/repos/vspinu/zotelo/issues/28","id":203329556,"user":{"login":"vspinu","id":1363467,"avatar_url":"https://avatars.githubusercontent.com/u/1363467?v=3","gravatar_id":"","url":"https://api.github.com/users/vspinu","html_url":"https://github.com/vspinu","followers_url":"https://api.github.com/users/vspinu/followers","following_url":"https://api.github.com/users/vspinu/following{/other_user}","gists_url":"https://api.github.com/users/vspinu/gists{/gist_id}","starred_url":"https://api.github.com/users/vspinu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vspinu/subscriptions","organizations_url":"https://api.github.com/users/vspinu/orgs","repos_url":"https://api.github.com/users/vspinu/repos","events_url":"https://api.github.com/users/vspinu/events{/privacy}","received_events_url":"https://api.github.com/users/vspinu/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T08:54:42Z","updated_at":"2016-03-30T08:54:42Z","body":"This is unfortunate. I always thought that ID is the key. Cannot we retrieve the \"key\" field ourselves? Sadly I am not using zotelo that much anymore nor I have the possibility to play with zotero on multiple machines right now. \r\n\r\nSo, if you can propose a patch with a reliable identification scheme, I would be more than happy to merge it in. Thanks."}}