{"action":"created","issue":{"url":"https://api.github.com/repos/mockingbot/react-native-zip-archive/issues/56","repository_url":"https://api.github.com/repos/mockingbot/react-native-zip-archive","labels_url":"https://api.github.com/repos/mockingbot/react-native-zip-archive/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/mockingbot/react-native-zip-archive/issues/56/comments","events_url":"https://api.github.com/repos/mockingbot/react-native-zip-archive/issues/56/events","html_url":"https://github.com/mockingbot/react-native-zip-archive/pull/56","id":244603739,"number":56,"title":"Android progress events & unzip on background thread.","user":{"login":"benvium","id":288569,"avatar_url":"https://avatars0.githubusercontent.com/u/288569?v=4","gravatar_id":"","url":"https://api.github.com/users/benvium","html_url":"https://github.com/benvium","followers_url":"https://api.github.com/users/benvium/followers","following_url":"https://api.github.com/users/benvium/following{/other_user}","gists_url":"https://api.github.com/users/benvium/gists{/gist_id}","starred_url":"https://api.github.com/users/benvium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benvium/subscriptions","organizations_url":"https://api.github.com/users/benvium/orgs","repos_url":"https://api.github.com/users/benvium/repos","events_url":"https://api.github.com/users/benvium/events{/privacy}","received_events_url":"https://api.github.com/users/benvium/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-07-21T08:47:07Z","updated_at":"2017-07-21T14:37:01Z","closed_at":"2017-07-21T14:29:42Z","pull_request":{"url":"https://api.github.com/repos/mockingbot/react-native-zip-archive/pulls/56","html_url":"https://github.com/mockingbot/react-native-zip-archive/pull/56","diff_url":"https://github.com/mockingbot/react-native-zip-archive/pull/56.diff","patch_url":"https://github.com/mockingbot/react-native-zip-archive/pull/56.patch"},"body":"- Unzipping now takes place on a background thread (as recommended by the RN docs). RN docs also say that sending events from background threads is ok, which is why I do it here.\r\n- The progress events will be fired at most 100 times (once per percent)\r\n- When unzipping from a file, accurate progress can be measured as we can determine the uncompressed size of each file.\r\n- When unzipping from assets, uncompressed sizes of files are not available, so we work around this by comparing the compressed size of the zip itself to the bytes extracted. This is (of course) less accurate.\r\n- Sadly the two above features make the code a bit longer, as we can no longer share the unzipStream method between the assets and files.  Unzipping using a stream doesn't give you the uncompressed sizes (as explained above).\r\n- I also fixed a couple of warnings in the Java code.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mockingbot/react-native-zip-archive/issues/comments/317018276","html_url":"https://github.com/mockingbot/react-native-zip-archive/pull/56#issuecomment-317018276","issue_url":"https://api.github.com/repos/mockingbot/react-native-zip-archive/issues/56","id":317018276,"user":{"login":"plrthink","id":2429369,"avatar_url":"https://avatars0.githubusercontent.com/u/2429369?v=4","gravatar_id":"","url":"https://api.github.com/users/plrthink","html_url":"https://github.com/plrthink","followers_url":"https://api.github.com/users/plrthink/followers","following_url":"https://api.github.com/users/plrthink/following{/other_user}","gists_url":"https://api.github.com/users/plrthink/gists{/gist_id}","starred_url":"https://api.github.com/users/plrthink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/plrthink/subscriptions","organizations_url":"https://api.github.com/users/plrthink/orgs","repos_url":"https://api.github.com/users/plrthink/repos","events_url":"https://api.github.com/users/plrthink/events{/privacy}","received_events_url":"https://api.github.com/users/plrthink/received_events","type":"User","site_admin":false},"created_at":"2017-07-21T14:37:01Z","updated_at":"2017-07-21T14:37:01Z","body":"@PeterEmanuel the iOS version was built only to meet our use case at first and not involved too much these days. And we still have a lot of features to built into this package. We are open to the community to improve these. So PRs are welcome.\r\n\r\nAs for the progress problem, we could leverage SSZipArchive to do this via the api @benvium mentioned above.\r\n"}}
{"actor":{"display_login":"plrthink"}}