Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device database entry will be created before user credentials are validated by Cloud service #289

Open
zhenx76 opened this issue Sep 22, 2015 · 0 comments

Comments

@zhenx76
Copy link

zhenx76 commented Sep 22, 2015

Hi,

I think I encountered a bug: When I was trying to add Nest cloud service to control the thermostat, I accidentally entered the wrong password at the very first time. This seems to be put the system to a state that I can't even correct the password. Here's what I think it happened:

  1. I entered the wrong password in d3 client, which will call "/api/v1/device/create" API to create the Nest cloud device;
  2. The create() function will call devices.discover() to discover existing device or add new device;
  3. In devices.discover() in device.js, a new Nest cloud object will be created and it will call login() to validate the user credentials;
  4. However, before the login() completes through callback, devices.discover() will go ahead and create the database entry, and store the wrong password;
  5. Later on, the login completes and complains about wrong password. Here the database entry will not be deleted or marked as invalid;
  6. Then I tried to "correct" password by adding a cloud service with the right password. This time devices.discover() will locate the device database entry (with wrong password), and it won't update the database entry with the right password.

Therefore the end result is that if I entered the wrong password for Nest for the first time, I can't connect to Nest any more. The only way to recover is to manually remove the invalid database entry.

@Faeranne Faeranne assigned Faeranne and unassigned Faeranne Oct 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants