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

Refreshing access token logic for get/createAudience #1767

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nick-Ag
Copy link
Member

@nick-Ag nick-Ag commented Dec 7, 2023

This PR updates getAudience and createAudience to use similar retry logic as regular streaming events when an invalid access token error occurs.

Testing

Include any additional information about the testing you have completed to
ensure your changes behave as expected. For a speedy review, please check
any of the tasks you completed below during your testing.

  • Added unit tests for new functionality
  • Tested end-to-end using the local server
  • [Segmenters] Tested in the staging environment

@nick-Ag nick-Ag changed the title [WIP not ready for review] - refreshToken logic for get/createAudience Refreshing access token logic for get/createAudience Dec 11, 2023
@nick-Ag
Copy link
Member Author

nick-Ag commented Dec 15, 2023

Paused on this one until Jan 2024

// Copied from onSubscriptions -> I don't think this options object will have the onTokenRefresh function...

if (options) {
await options?.onTokenRefresh?.(newTokens)

Choose a reason for hiding this comment

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

should you do a try / catch here if it's possible to get error onTokenRefresh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants