Skip to content

Retries a 401 error by refreshing the access token#121

Open
vishalp-dev wants to merge 13 commits into
masterfrom
tdl-27089-fix-retry-token-expiry
Open

Retries a 401 error by refreshing the access token#121
vishalp-dev wants to merge 13 commits into
masterfrom
tdl-27089-fix-retry-token-expiry

Conversation

@vishalp-dev

@vishalp-dev vishalp-dev commented Mar 12, 2025

Copy link
Copy Markdown
Member

Description of change

Long Running extractions do not complete due to the short lived nature of the xero access tokens, and the tap is incapable to rotate a expired access_token amidst an ongoing extraction, this pr updates the tap implementation to handle 401 issues and retry the api call after refreshing the access_token.

Summary of Changes:

  • Added Backoff & exception handling for 401
  • Added Reauthentication for 401 error
  • updated to write accees_token to config file

Note:
Xero Access tokens are short lived and currently there is no way to debug any issue with a locally cloned connection without breaking the token chain on the orignal connection.

Manual QA steps

Risks

Minimal

Rollback steps

  • revert this branch

AI generated code

https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code

  • this PR has been written with the help of GitHub Copilot or another generative AI tool

Comment thread tap_xero/__init__.py
Comment on lines +67 to +68
def ensure_credentials_are_valid(config, config_path):
XeroClient(config, config_path).filter("currencies")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is unused throughout the code

@vishalp-dev
vishalp-dev marked this pull request as draft March 27, 2025 11:44
@vishalp-dev
vishalp-dev marked this pull request as ready for review October 9, 2025 14:07
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