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

fix: don't enter error state when request is aborted #207

Merged
merged 1 commit into from
May 21, 2024

Conversation

andrew-pledge-io
Copy link
Contributor

@andrew-pledge-io andrew-pledge-io commented May 17, 2024

About the changes

Prevents the SDK entering the error state when a request is aborted. An aborted request doesn't indicate that there's an error, only that a new request has superseded the previous one.

An example of the current behavior:

  1. Application starts up <- starts in initializing state
  2. Request for flags A
  3. Context updated with userId
  4. Request for flags B
  5. Request for flags A cancelled <- transitions to error state
  6. Request for flags B completed <- transitions to healthy state

Expected behavior:

  1. Application starts up <- starts in initializing state
  2. Request for flags A
  3. Context updated with userId
  4. Request for flags B
  5. Request for flags A cancelled <- remains in initializing state
  6. Request for flags B completed <- transitions to healthy state

I noticed this because in our case Sentry captures console.error messages, and we are seeing a lot of Sentry issues due to the console.error in the catch handler.

@kwasniew
Copy link
Contributor

Thanks for submitting this PR. We'll be looking into this today.

@kwasniew kwasniew self-requested a review May 21, 2024 10:15
@kwasniew
Copy link
Contributor

@andrew-pledge-io Thanks for your contribution. I tested it locally and it works fine. Merging it now and I will followup with a unit test.

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.

2 participants