Skip to content

retry 401s from the envoy#90

Open
djk121 wants to merge 1 commit intojesserizzo:mainfrom
djk121:retry_401s
Open

retry 401s from the envoy#90
djk121 wants to merge 1 commit intojesserizzo:mainfrom
djk121:retry_401s

Conversation

@djk121
Copy link
Copy Markdown

@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