Skip to content

Rewrite / refactor. Added support for sandboxes and buffers. #16

Closed
wants to merge 23 commits into from

3 participants

@ralphholzmann

Hey Evan,

Thanks for your great client library. I'm using it on a private project right now and I've been wrestling with some base signature errors in certain cases (mainly when transferring with filenames containing spaces, symbols etc) with the Dropbox API. I rewrote and refactored your library to better nail down these issues. It looks like both your lib and the OAuth lib were percent encoding data when they shouldn't be. My next task is to refactor the OAuth lib, which will be a much larger task ;).

I DRYed up a bunch of code and I've added support for transferring raw buffers and sandboxes as well, and also formatted it to my liking -- nothing against the comma first format, I'm just not into it, and this lib will be the core of my application so I want to be able to know it inside and out as well as edit it as I need to. Unfortunately, I did this refactor off of 0.3.0, so the file stream stuff didn't get included, however it would be trivial to add. Also, the changes I made to putFile are backwards incompatible (no longer provide a filename and a path -- just a path).

I don't expect you to actually merge this pull request as it's quite a radical change (backwards incompats, underscore dependency, constructor name change), however, I'm hoping you can use some of the code and DRY techniques in this commit and apply it to your lib. In the mean time, I'll likely split this off into it's own project with high praise and credit to you.

Thanks,

Ralph

@nils-werner

Great work! It's a bit unfortunate that you did everything in one huge single commit. Splitting the work would've made it more readable for us others. :-)

@ralphholzmann

@nils-werner Ah, yeah. Sorry about that. I was on a roll and just kept on coding. That being said, if you look at the file rather than the diff, you'll be able to easily discern the differences. Github doesn't do well with rewrites :/

https://github.com/ralphholzmann/dropbox-node/blob/99811fe3a59b414cd0ef17de8ef897ac038cb12c/lib/dropbox-node.js

@nils-werner

Does your rewrite fix the issue with unicode filenames or will that require the oAuth rewrite you mentioned? Also, would it be possible to back-port that fix into the current master-branch without applying the complete rewrite?

@ralphholzmann

@nils-werner -- I believe that's an issue with the current state of the oAuth lib because they send their requests in utf8 when the dropbox api requires they be sent in binary. I posted an issue about it here but they have yet to move on it.

@evnm
Owner
evnm commented Jul 24, 2011

Very nice! Appreciate the fresh take on the code.

@evnm evnm closed this Mar 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.