{"action":"created","issue":{"url":"https://api.github.com/repos/datproject/dat-node/issues/157","repository_url":"https://api.github.com/repos/datproject/dat-node","labels_url":"https://api.github.com/repos/datproject/dat-node/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/datproject/dat-node/issues/157/comments","events_url":"https://api.github.com/repos/datproject/dat-node/issues/157/events","html_url":"https://github.com/datproject/dat-node/issues/157","id":236661635,"number":157,"title":"on importFiles() ‘count’ event is fired after first ‘put’ event","user":{"login":"e-e-e","id":12589522,"avatar_url":"https://avatars2.githubusercontent.com/u/12589522?v=3","gravatar_id":"","url":"https://api.github.com/users/e-e-e","html_url":"https://github.com/e-e-e","followers_url":"https://api.github.com/users/e-e-e/followers","following_url":"https://api.github.com/users/e-e-e/following{/other_user}","gists_url":"https://api.github.com/users/e-e-e/gists{/gist_id}","starred_url":"https://api.github.com/users/e-e-e/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e-e-e/subscriptions","organizations_url":"https://api.github.com/users/e-e-e/orgs","repos_url":"https://api.github.com/users/e-e-e/repos","events_url":"https://api.github.com/users/e-e-e/events{/privacy}","received_events_url":"https://api.github.com/users/e-e-e/received_events","type":"User","site_admin":false},"labels":[{"id":546448170,"url":"https://api.github.com/repos/datproject/dat-node/labels/Type:%20Question","name":"Type: Question","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-06-17T13:48:32Z","updated_at":"2017-06-23T19:41:55Z","closed_at":null,"body":"Is this intended behaviour?\r\n\r\nCurrent behaviour means that we can’t get a proper progress reading on the first few ‘put’ events.\r\nThis could be easily solved by waiting until the dry run - https://github.com/datproject/dat-node/blob/master/lib/import-files.js#L36-L49 - is completed until starting the mirroring process. But then this will also slow down the process of importing for larger dats."},"comment":{"url":"https://api.github.com/repos/datproject/dat-node/issues/comments/310755887","html_url":"https://github.com/datproject/dat-node/issues/157#issuecomment-310755887","issue_url":"https://api.github.com/repos/datproject/dat-node/issues/157","id":310755887,"user":{"login":"joehand","id":684965,"avatar_url":"https://avatars3.githubusercontent.com/u/684965?v=3","gravatar_id":"","url":"https://api.github.com/users/joehand","html_url":"https://github.com/joehand","followers_url":"https://api.github.com/users/joehand/followers","following_url":"https://api.github.com/users/joehand/following{/other_user}","gists_url":"https://api.github.com/users/joehand/gists{/gist_id}","starred_url":"https://api.github.com/users/joehand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehand/subscriptions","organizations_url":"https://api.github.com/users/joehand/orgs","repos_url":"https://api.github.com/users/joehand/repos","events_url":"https://api.github.com/users/joehand/events{/privacy}","received_events_url":"https://api.github.com/users/joehand/received_events","type":"User","site_admin":false},"created_at":"2017-06-23T19:41:55Z","updated_at":"2017-06-23T19:41:55Z","body":"> Perhaps it could be useful to implement some sort of approximation indicator for while the initial count is still being calculated\r\n\r\nYea, this is how I started the implementation in CLI. It definitely works well for *new dat* imports. Where it gets strange is resuming old dats (especially big ones) and live imports. You still need to take into account if the count is finished or not for the UI to make sense, this is part of why I left it up to the implementation.\r\n\r\nI think I'd be okay to expose something like: \r\n\r\n```js\r\nimporter.stats = {\r\n  remaining: 10 // count\r\n  imported: 5 // importer.on('put')\r\n  liveImports: 9 // this isn't reflected in remaining\r\n}\r\n```\r\n\r\nWhere I really get stuck up is the live importing, since that isn't reflected in the dry run counts. And those imports happen immediately, skipping the line of `remaining`. Happy to review any PRs or docs =).\r\n\r\nYou probably have seen it, but if not, it may be worth going through the [CLI import usage](https://github.com/datproject/dat/blob/master/src/ui/components/import-progress.js) (though I think there are a few edge cases I still haven't caught). The part that is hard is if [count isn't done](https://github.com/datproject/dat/blob/master/src/ui/components/import-progress.js#L13-L21). \r\n\r\n"}}
{"actor":{"display_login":"joehand"}}