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

retry 401s from the envoy #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

djk121
Copy link

@djk121 djk121 commented Feb 17, 2022

Because there can be enough time between when _is_enphase_token_expired()
is called and when the subsequent http request to the envoy happens,
the token freshness check can pass but the envoy will still see an
expired token. This results in a 401 from the envoy, which raises
an exception.

This change looks for these 401s and attempts to refresh the
token twice before giving up.

Pull request recommendations:

  • Name your pull request your-development-type/short-description. Ex: feature/read-tiff-files
  • Link to any relevant issue in the PR description. Ex: Resolves [Improve library and HA integration to reduce number of HTTP calls to Envoy device #12], adds tiff file format support
  • Provide context of changes.
  • Provide relevant tests for your feature or bug fix.
  • Provide or update documentation for any feature added by your pull request.

Thanks for contributing!

Because there can be enough time between when _is_enphase_token_expired()
is called and when the subsequent http request to the envoy happens,
the token freshness check can pass but the envoy will still see an
expired token. This results in a 401 from the envoy, which raises
an exception.

This change looks for these 401s and attempts to refresh the
token twice before giving up.
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

Successfully merging this pull request may close these issues.

1 participant