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

[db] Pass preferred region for token management #10428

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

FredKSchott
Copy link
Member

Changes

  • Currently, we create a short-lived Studio token through the Studio API.
  • This is creating a race condition where the token is created in the API's region (iad) but not yet propagated to the region closest to the user (sjc, ams, etc). This presents as a "TOKEN_UNUAUTHORIZED" error because the region closest to the user assume's it's a bad token.
  • This PR fixes the issue by capturing the region code closest to the user, and then passing that to the Studio API. The Studio API then makes sure that the token created/renewed/deleted will be instantly up-to-date in that region before returning.

Testing

  • Manually

Docs

  • N/A

Copy link

changeset-bot bot commented Mar 13, 2024

🦋 Changeset detected

Latest commit: 3d47c57

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@FredKSchott FredKSchott force-pushed the add-region-support-to-db-calls branch from f6f5781 to 3387898 Compare March 13, 2024 18:14
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Can't speak to the Studio side of this code, but this all seems reasonable to me!

Copy link
Contributor

@matthewp matthewp left a comment

Choose a reason for hiding this comment

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

Needs API change, so blocking for the moment.

@FredKSchott FredKSchott force-pushed the add-region-support-to-db-calls branch from 3387898 to 069e7ed Compare March 13, 2024 18:37
@FredKSchott FredKSchott force-pushed the add-region-support-to-db-calls branch from 069e7ed to 3d47c57 Compare March 13, 2024 18:55
@FredKSchott FredKSchott merged commit 189ec47 into main Mar 13, 2024
13 checks passed
@FredKSchott FredKSchott deleted the add-region-support-to-db-calls branch March 13, 2024 19:50
@astrobot-houston astrobot-houston mentioned this pull request Mar 13, 2024
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.

3 participants