{"action":"opened","issue":{"url":"https://api.github.com/repos/amark/gun/issues/125","labels_url":"https://api.github.com/repos/amark/gun/issues/125/labels{/name}","comments_url":"https://api.github.com/repos/amark/gun/issues/125/comments","events_url":"https://api.github.com/repos/amark/gun/issues/125/events","html_url":"https://github.com/amark/gun/issues/125","id":117349032,"number":125,"title":"json filestore seems broken","user":{"login":"thoka","id":56247,"avatar_url":"https://avatars.githubusercontent.com/u/56247?v=3","gravatar_id":"","url":"https://api.github.com/users/thoka","html_url":"https://github.com/thoka","followers_url":"https://api.github.com/users/thoka/followers","following_url":"https://api.github.com/users/thoka/following{/other_user}","gists_url":"https://api.github.com/users/thoka/gists{/gist_id}","starred_url":"https://api.github.com/users/thoka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thoka/subscriptions","organizations_url":"https://api.github.com/users/thoka/orgs","repos_url":"https://api.github.com/users/thoka/repos","events_url":"https://api.github.com/users/thoka/events{/privacy}","received_events_url":"https://api.github.com/users/thoka/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-17T12:53:00Z","updated_at":"2015-11-17T12:53:00Z","closed_at":null,"body":"If I reuse a json filestore, node values seem to be overwritten.\r\n\r\nAdditionally, the file size is not truncated, so the json will not be valid any more.\r\n\r\ntest1.coffee:\r\n```coffeescript\r\nGun = require \"gun\"\r\ngun = Gun file:\"data.json\"\r\nfor num in [1..10]\r\n    gun.put name:\"test #{num}\"\r\n```\r\n\r\ntest2.coffee:\r\n```coffeescript\r\nGun = require \"gun\"\r\ngun = Gun file:\"data.json\"\r\ngun.put({}).key(\"test2\")\r\n```\r\n\r\ntest.sh:\r\n```bash\r\nrm data.json\r\ncoffee test1.coffee && prettyjson data.json\r\ncoffee test2.coffee && prettyjson data.json\r\n```\r\n\r\n\r\n\r\n\r\n"}}