{"action":"created","issue":{"url":"https://api.github.com/repos/nolanlawson/local-npm/issues/45","labels_url":"https://api.github.com/repos/nolanlawson/local-npm/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/nolanlawson/local-npm/issues/45/comments","events_url":"https://api.github.com/repos/nolanlawson/local-npm/issues/45/events","html_url":"https://github.com/nolanlawson/local-npm/issues/45","id":99943661,"number":45,"title":"Starts re-replicating from scratch sometimes","user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-10T00:32:22Z","updated_at":"2016-01-21T15:42:42Z","closed_at":null,"body":"@remy For the record, I am still seeing this sometimes. Happened a moment ago when my laptop went into hibernate mode and then restarted; might be related. Still, since the checkpoint is stored on disk, there's no reason it should start re-replicating from scratch.\r\n\r\n```\r\n...\r\nlocal-npm-0 Replicating skimdb, last_seq is: 35869 (18.74%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 36071 (18.84%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 36271 (18.95%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 36472 (19.05%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 36674 (19.16%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 36875 (19.26%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 37076 (19.37%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 37276 (19.47%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 37476 (19.58%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 37677 (19.68%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 37877 (19.78%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 38077 (19.89%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 38277 (19.99%)\r\nlocal-npm-0 Replicating skimdb, last_seq is: 38478 (20.1%)\r\n```"},"comment":{"url":"https://api.github.com/repos/nolanlawson/local-npm/issues/comments/173610887","html_url":"https://github.com/nolanlawson/local-npm/issues/45#issuecomment-173610887","issue_url":"https://api.github.com/repos/nolanlawson/local-npm/issues/45","id":173610887,"user":{"login":"nolanlawson","id":283842,"avatar_url":"https://avatars.githubusercontent.com/u/283842?v=3","gravatar_id":"","url":"https://api.github.com/users/nolanlawson","html_url":"https://github.com/nolanlawson","followers_url":"https://api.github.com/users/nolanlawson/followers","following_url":"https://api.github.com/users/nolanlawson/following{/other_user}","gists_url":"https://api.github.com/users/nolanlawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nolanlawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nolanlawson/subscriptions","organizations_url":"https://api.github.com/users/nolanlawson/orgs","repos_url":"https://api.github.com/users/nolanlawson/repos","events_url":"https://api.github.com/users/nolanlawson/events{/privacy}","received_events_url":"https://api.github.com/users/nolanlawson/received_events","type":"User","site_admin":false},"created_at":"2016-01-21T15:42:42Z","updated_at":"2016-01-21T15:42:42Z","body":"I honestly don't understand what the difference is if you run it as a LaunchAgent, but it seems like a file/permissions thing to me? Maybe when it runs as a LaunchAgent the files are saved with a particular set of permissions, and then those don't transfer over when you run it normally?\r\n\r\nTo test, you can try running `local-npm` _only_ in regular mode (without the LaunchAgent), and I guarantee it will not start re-replicating from scratch. The way it works is that it writes checkpoints to the local PouchDB database, so as long as it has access to that checkpoint file, it should work fine. Also: keep in mind that LevelDB databases can't be accessed by more than one Node.js process, so trying to run 2 at once could cause unexpected behavior..."}}