Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screenshot needs to be deleted from filesystem #158

Open
Glench opened this issue Nov 6, 2017 · 1 comment
Open

Screenshot needs to be deleted from filesystem #158

Glench opened this issue Nov 6, 2017 · 1 comment

Comments

@Glench
Copy link
Contributor

Glench commented Nov 6, 2017

Right now the only place the screenshot is being deleted is after a Twitter post:

twitter.post('statuses/update', params, function(err) {
    if (err) {
        console.log(err)
    }
})
fs.unlink(screenshot)

The screenshot needs to be deleted in the following cases: if the user only is posting to Mastodon and not Twitter, if the screenshot was not uploaded to Twitter successfully (the callback returns so the fs.unlink code is never hit).

I used async for the screenshot code before because it simplified the coordination of all these async network requests a lot.

@edsu
Copy link
Owner

edsu commented Nov 7, 2017

Thanks for catching this. As part of #159 I'm going to reintroduce your async/await code which should make handling this easier. I'll leave this ticket open as a reminder to double check the screenshot isn't left sitting around for this case where Mastodon is configured and Twitter is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants