{"action":"created","issue":{"url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/602","labels_url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/602/labels{/name}","comments_url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/602/comments","events_url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/602/events","html_url":"https://github.com/CollectionFS/Meteor-CollectionFS/issues/602","id":60786383,"number":602,"title":"Question: How to wait until writeStream finished?","user":{"login":"lugaru90","id":5918938,"avatar_url":"https://avatars.githubusercontent.com/u/5918938?v=3","gravatar_id":"","url":"https://api.github.com/users/lugaru90","html_url":"https://github.com/lugaru90","followers_url":"https://api.github.com/users/lugaru90/followers","following_url":"https://api.github.com/users/lugaru90/following{/other_user}","gists_url":"https://api.github.com/users/lugaru90/gists{/gist_id}","starred_url":"https://api.github.com/users/lugaru90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lugaru90/subscriptions","organizations_url":"https://api.github.com/users/lugaru90/orgs","repos_url":"https://api.github.com/users/lugaru90/repos","events_url":"https://api.github.com/users/lugaru90/events{/privacy}","received_events_url":"https://api.github.com/users/lugaru90/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-12T08:37:50Z","updated_at":"2015-03-12T12:43:11Z","closed_at":null,"body":"Hey,\r\n\r\ni'm uploading an image, later on let the user crop the image and use the following command to update the Thumbnail image:\r\n```javascript\r\nvar imageFile = Images.findOne({'metadata.user': Meteor.user()._id, 'metadata.isNew':true});\r\nvar readStream = imageFile.createReadStream('thumbs');\r\nvar writeStream = imageFile.createWriteStream('thumbs');\r\ngm(readStream, imageFile.name()).resize('100', '100').stream().pipe(writeStream);\r\n```\r\n\r\nAfterwards call the Update Function to set a metadata active Flag. This works fine but shows a not found image on the Template, until the User refreshs.\r\n\r\nSo is there a way to wait until the writestream is finished?\r\n\r\nEDIT ADD: Also the Browser/Meteor (idk)  don't recognize that the Image has resized and uses the Old Image... Any fix for this?"},"comment":{"url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/comments/78472358","html_url":"https://github.com/CollectionFS/Meteor-CollectionFS/issues/602#issuecomment-78472358","issue_url":"https://api.github.com/repos/CollectionFS/Meteor-CollectionFS/issues/602","id":78472358,"user":{"login":"raix","id":1136718,"avatar_url":"https://avatars.githubusercontent.com/u/1136718?v=3","gravatar_id":"","url":"https://api.github.com/users/raix","html_url":"https://github.com/raix","followers_url":"https://api.github.com/users/raix/followers","following_url":"https://api.github.com/users/raix/following{/other_user}","gists_url":"https://api.github.com/users/raix/gists{/gist_id}","starred_url":"https://api.github.com/users/raix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raix/subscriptions","organizations_url":"https://api.github.com/users/raix/orgs","repos_url":"https://api.github.com/users/raix/repos","events_url":"https://api.github.com/users/raix/events{/privacy}","received_events_url":"https://api.github.com/users/raix/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T12:43:11Z","updated_at":"2015-03-12T12:43:11Z","body":"Please read the official node js documentation on streams - you could use events"}}