wayneashleyberry / wunderline

✅️ Command-line client for Wunderlist, the easiest way to get stuff done.
https://git.io/vM45l
MIT License
309 stars 29 forks source link

Refactor main to use async.waterfall properly #113

Closed Thor77 closed 6 years ago

Thor77 commented 6 years ago

We didn't use async.waterfalls error handling capabilities at all and just implemented error handling for each sub-request separetely, this Pull Request will replace those occurences with a call to callback passing the error and handling it at one, central point.

While looking at asyncs documentation I realized my assumption in #111 about the order of eachOf-execution was wrong so I changed it to use it instead of eachOfSeries which gave us an unused index-argument. There was a call to callback missing at the end as well, so async.waterfalls final callback was never executed (therefore "disabling" --open-functionality).

Additionaly I renamed all short-forms of variable names to their long forms because I don't really see a value in making the code less readable just to save some space (or some typing if your editor doesn't support auto-completion), but I can take those commits out if you don't agree on that.

This should fix the blocking problems in #94 as well.

alexandrebarbaruiva commented 6 years ago

@Thor77 is there anything I can do to help here? Or any issue you think is relatively easy and I can work on it

Thor77 commented 6 years ago

@alexandrebarbaruiva No, this PR is basically finished. I'm not sure if it's easy but 49 is something you could work on.

wayneashleyberry commented 6 years ago

Hey @Thor77, would you mind resolving conflicts then we can get this in?

Thor77 commented 6 years ago

@wayneashleyberry done. Please notify me before merging so I can squash my commits.

Thor77 commented 6 years ago

@wayneashleyberry alright, thanks for merging :+1: I just discovered the fix from #117 somehow moved one line up (or it wasn't a problem before these changes). Will fix that directly on master. Edit: Fixed as a33eb09b214ae6f8c6f8862362405e3b6d50f810

wayneashleyberry commented 6 years ago

Great! Thanks @Thor77