Giter VIP home page Giter VIP logo

Comments (13)

brentleeper avatar brentleeper commented on May 26, 2024 2

Opened PR: #108

from homebridge-hatch-baby-rest.

brentleeper avatar brentleeper commented on May 26, 2024 1

I am on my phone currently but I just opened a PR to address this issue. It should be noted I have very little context 😅 and working off some assumptions but the maintainer should get the idea and be able to edit as needed.

from homebridge-hatch-baby-rest.

dgreif avatar dgreif commented on May 26, 2024 1

The fix from #108 has been released in 4.0.1. Please let me know if this resolves your issues @parsap

from homebridge-hatch-baby-rest.

eightball011854 avatar eightball011854 commented on May 26, 2024 1

@dgreif major thanks for this and the ring fix last weekend - you are the best of the best of the best!

from homebridge-hatch-baby-rest.

parsap avatar parsap commented on May 26, 2024 1

Confirmed fixed!

from homebridge-hatch-baby-rest.

joshuaseltzer avatar joshuaseltzer commented on May 26, 2024

Same error on my instance. Looks like the OAuth flow is failing. Guessing their API is either down or it changed...

from homebridge-hatch-baby-rest.

brentleeper avatar brentleeper commented on May 26, 2024

Looks like the following header needs to be added to each request.

USER_AGENT: "hatch_rest_api"

from homebridge-hatch-baby-rest.

brentleeper avatar brentleeper commented on May 26, 2024

… well actually… let me try to understand this a bit more

from homebridge-hatch-baby-rest.

brentleeper avatar brentleeper commented on May 26, 2024

Yes, that is correct. All api requests now require the above mentioned header, including the login request.

from homebridge-hatch-baby-rest.

joshuaseltzer avatar joshuaseltzer commented on May 26, 2024

@brentleeper nice discovery! Hopefully the fix is just as simple as adding that header to the requests made by this plugin.

I'd do a PR myself, but I'm not at all familiar with developing these plugins or even the language used here.

from homebridge-hatch-baby-rest.

joshuaseltzer avatar joshuaseltzer commented on May 26, 2024

The fix from #108 has been released in 4.0.1. Please let me know if this resolves your issues @parsap

I can personally confirm 4.0.1 is working again on my install.

Thanks again for quickly publishing this update! Couldn't live without it.

from homebridge-hatch-baby-rest.

kenwdelong avatar kenwdelong commented on May 26, 2024

So just to be clear - the 500s were due to a bug on our end; now fixed. The user-agent is a bit of a red herring: it could have been set to "bobs-your-uncle" and that would have avoided the bug.

The bug manifested because we are implementing some rate-limiting. Someone mentioned being in a infinite loop of 500s - there are quite a few people using this library in an infinite loop of 200s (successful logins). There are clients out there sending tens of thousands of login attempts per day. This is one of the things that prompted us to implement rate limiting!

We meant to look over the project and submit some pull requests to fix the infinite-login-loop problem, but we just haven't had the time. It would be great if someone could figure it out. The login tokens are valid for years. But be aware that as soon as we get this code spruced up the infinite login loops will be getting 429 responses, regardless of user-agent.

from homebridge-hatch-baby-rest.

dgreif avatar dgreif commented on May 26, 2024

Thanks for the heads up @kenwdelong, and sorry for the infinite loop login attempts! I didn't realize that was happening and haven't seen anything like that on my end, but I would gladly accept some PRs if you find the offending code.

from homebridge-hatch-baby-rest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.