🎉 Refresh tokens in node-red-node-dropbox (Now published as v2.0.0)

@dceejay: will submit the PR in a couple of weeks. Currently unfortunately I don't have time to do any oauth2 troubleshooting. My private life is quite messed up...

ah right - no worries - (I was on vacation and forgot where we had got to).
Good luck with life !

1 Like

@Paul-Reed, I just saw this. Thanks for your continuing effort to get this working.

And, thank you @BartButenaers for what you've done. Just started playing with it, but it seems very solid.

@FSHelgeland have you seen this?

3 Likes

No luck. This is what those 2 folders look like now. I added "OLD_" to original version of the files so you can tell what was replaced.
image

image

This is result when I try to start Node Red:

Stephen, Is your dropbox node up to date to start with, - v1.1.1 ?
If so, it's most likely a copy/paste error.

The way I did it is;

  1. Like you already have done, change the existing files names mv dropbox.js OLD_dropbox.js etc. so can always roll back.

  2. Open Bart's git fork to the file that you want to copy - dropbox.js
    Use the 'Copy Raw Contents' button to copy the file contents -
    copy

  3. In your dropbox folder create the new file - nano dropbox.js and paste the code that you've copied. Save the file.

  4. Do the same for the other 2 3 files, and then restart node-RED

[EDIT - ] Also update the package.json file as it now contains the latest 'dropbox library' and run npm update from within the dropbox folder to update the library.

Now i have, thank you :slight_smile:

1 Like


Where do I go wrong?

@BartButenaers hasn't published to npm yet (personal commitments).
If you want to try it before it has been published, have a look at my last post, otherwise, hopefully it will be published in the near future.

Aha, I have to admit I didnt reed all of it.

@stephenn Did you try again?

I tried again then started getting error messages during Node Red Start referencing my August Lock nodes that were keeping Node Red from starting. I have no idea how one would have caused the error to other. After some time of panic, I was able to get a backup copy downloaded and reloaded so I am apprehensive about trying to do another attempt at Dropbox. I will wait until there is an option to simply load thru the Pallet Manager or I find a way to do backup to another app such as Google Drive or similar. In the meantime, I will just enter a token every 3 days manually. No big deal. I have the flow set to do backup automatically so it reminds me every 3 days when it fails.

1 Like

This is very strange but I noticed today that I was getting a warning message about my dropbox credentials. When I checked I saw that it reverted back to 1.1.1. Anyone have any ideas why it did that?

Strange, I can't imagine how node-RED could roll back to a previous app version unless you have restored a backup, or re-installed the app.
Was your previous Dropbox at v2.0.0?

How did you upgrade?

I was at 2.0.0 then I noticed it wasn't uploading any longer. When I checked it was back to 1.1.1. I haven't restored or reinstalled, so I'm not sure what caused the roll back. I redownloaded the files from GitHub and now it's back to 2.0.0. For some reason tonight I had to redo my OAuth again though. Not sure what's up with that.

I just followed the procedure listed above. Went to @BartButenaers fork on GitHub at node-red-web-nodes/dropbox at master · bartbutenaers/node-red-web-nodes · GitHub and grabbed the updated files. Then followed the directions in the configuration node to set it up.

Do you mean that you just replaced the files in node_modules? If you do that without telling npm then the next time you do anything with npm it will restore whatever is defined in package.json and package-lock.json. You need to update those somehow. Normally to install a package direct from github one would do something like
npm install bartbutenears/node-red-node-dropbox
but that doesn't seem to work, I guess because that node is in a collection of nodes. Perhaps @Paul-Reed or @BartButenaers can help.

npm install bartbutenears/node-red-node-dropbox didn't work for me either, and I just copied/pasted the 'raw' code from Bart's repo for the 3 files (as I described above).
It's not the easiest process, and a recipe for errors :rage:

I've already asked @dceejay if there was an alternative way to install...

OK, this seemed to work for me. Go into a directory outside of .node-red (I used my home directory ~) then
git clone https://github.com/bartbutenaers/node-red-web-nodes
Which downloads those nodes to the folder node-red-web-nodes under wherever you are. Then go into node-red-web-nodes/dropbox and run
npm install
Then go back to .node-red and run
npm install your_folder/node-red-web-nodes/dropbox
Then restart node-red and refresh the browser.

So for me on linux I did

cd ~
git clone https://github.com/bartbutenaers/node-red-web-nodes
cd node-red-web-nodes/dropbox
npm install
cd ~/.node-red
npm install ~/node-red-web-nodes/dropbox
node-red-stop;node-red-start

and refresh the browser. Do not delete the node-red-web-nodes folder.

[Edit] Once it has been released to npm then

npm remove node-red-node-dropbox
npm install node-red-node-dropbox

and you can delete the node-red-web-nodes folder.

4 Likes

That worked perfectly! Thanks!

1 Like