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

[Feature request]: Initialization flow #211

Closed
fuatakgun opened this issue May 10, 2023 · 6 comments
Closed

[Feature request]: Initialization flow #211

fuatakgun opened this issue May 10, 2023 · 6 comments
Labels
bug Something isn't working fixed

Comments

@fuatakgun
Copy link
Contributor

fuatakgun commented May 10, 2023

Describe the solution you'd like

Cont. from #150

I am having issues to receive captcha/verification (2fa) events from WS on container, assuming that before I can even reach to start listening state, WS on container had already tried logging in and received respective events.

So timeline perspective;

  • t0: launch the docker container with login credentials
  • t1: receive captcha or verification (2fa) but it would not be delivered any client as there is none yet
  • t2: client connects and activate start listening
  • t3: client does not know about current state regarding to captcha or verify (2fa) so it cannot react accordingly.

Suggestions;

  • we can wait for the first client to initiate login flow, this might be an extreme change given the impact on all other consumers (not sure how many)
  • we can create a new command to initiate login flow.
@fuatakgun fuatakgun added the enhancement New feature or request label May 10, 2023
@bropat
Copy link
Owner

bropat commented May 10, 2023

As soon as eufy-security-ws receives a captcha request, it is cached so that every client that connects and executes start listening also receives the event as long as no client has sent the captcha. Look here and here.
What has not been implemented is whether a captcha has expired in the meantime (this information is not available and could only be implemented with a simple timer), but if the captcha request is answered incorrectly, you get another one right away ;)

we can create a new command to initiate login flow.

There is already a command to initiate a connection. See here.

@fuatakgun
Copy link
Contributor Author

I remember it was the case but yesterday i tried with 1.4.1 and i didn't receive captcha event. Even after trying driver.connect didn't receive respective events, let me double check and share the logs

This gets more problematic when user had enabled 2fa because they will get multiple emails (one delivered at docker startup and one after driver connect)

@fuatakgun
Copy link
Contributor Author

my findings;

@fuatakgun
Copy link
Contributor Author

when I am running client against server, this is the response;

ts-node src/bin/client.ts 
{
  type: 'version',
  driverVersion: '2.5.1',
  serverVersion: '1.4.1',
  minSchemaVersion: 0,
  maxSchemaVersion: 17
}
{
  type: 'result',
  success: true,
  messageId: 'api-schema-id',
  result: {}
}

@Hufflepuff-source

This comment was marked as off-topic.

@bropat
Copy link
Owner

bropat commented Aug 1, 2023

@fuatakgun checkout latest version (1.6.0).

@bropat bropat added bug Something isn't working fixed and removed enhancement New feature or request labels Aug 3, 2023
@bropat bropat closed this as completed Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

3 participants