hepcat72 / node-red-contrib-life360

GNU General Public License v3.0
3 stars 4 forks source link

Migrate to axios, small refactoring #10

Closed MaksimShakavin closed 2 years ago

MaksimShakavin commented 2 years ago

Hello guys, Following our discussion in https://github.com/hepcat72/node-red-contrib-life360/issues/8 I replaced a deprecated "request" library with an axios. Also did a small refactoring of an error handling and how we are working with promises. I've installed it to my home automation NR. So will keep an eye on it a couple of days and test. But I would really appreciate your testing and review

hepcat72 commented 2 years ago

How has your testing gone? I have not had the opportunity to test. Still ridic busy with so many other things.

MaksimShakavin commented 2 years ago

So far so good. I can see connection error in the logs from time to time, but none of it crashes NR image

brianmay commented 2 years ago

I think maybe those "Cannot read property 'status' of undefined messages might indicate a problem somewhere.

Not so concerned about the 503 errors, looks like these come from the server.

hepcat72 commented 2 years ago

This is great. Thanks for the contributions guys. I haven't had real time to do anything other than briefly skim these changes, but I will get around to it eventually. Going to go ahead and merge since I think you guys are on top of it.

MaksimShakavin commented 2 years ago

I think maybe those "Cannot read property 'status' of undefined messages might indicate a problem somewhere.

Not so concerned about the 503 errors, looks like these come from the server.

you are right, this 'status of undefined' is coming from an error handling, when request isn't actually made(possibly because of DNS errors that I face sometimes) and request is undefined. I will fix it in the next pr