Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR lets a device whose binding is no longer verified authenticate again on its own, instead of failing every connection until someone opens the EcoFlow app. A device advertises whether it still holds a verified binding for the account, and that flag decides which of two authentication messages it will accept: the one that checks the binding, or the one that writes it back. We only ever sent the check, so a device that stopped reporting itself as verified could never recover locally.
Both messages carry the same secret we already compute, so the fix is to send the one the device is asking for.
Full list of changes:
A device holding a binding for a different account is unaffected: asked to refresh with a secret that is not its own, it refuses and keeps the binding it has. So this cannot move a device between accounts, and it equally cannot repair that situation, which still needs the device to be removed and re-added.
Verified on a Delta 3 Plus. While the device advertised a verified binding it authenticated through the check as before, and a refresh was refused with an error code and the link dropped, which is what makes the flag worth reading rather than always writing. After clearing the binding the device advertised itself as unverified, and this branch authenticated it immediately over Bluetooth with no app and no internet involved. The needs-binding reply could not be reproduced on that device on demand, so that path is covered by unit-level checks rather than hardware; reporters whose devices fall into this state every few days are the ones who can confirm the recurring case, which no local test can reproduce.
Resolves #471