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 for SDK stuck in bad state when email or phone number fails API validation #127

Merged
merged 6 commits into from
Dec 13, 2023

Conversation

ajaysubra
Copy link
Contributor

Description

We had a customer open a issue where they pointed out that the app is stuck in a bad state whenever the email or phone number fails validation. This code aims to do two things -

  1. If the phone number fails API validation we will erase the state and dequeue this request.
  2. If the email is invalid, we do the same, reset the state and dequeue the request.

We try to keep the SDK fairly light weight and dequeue the request vs. trying again.

Check List

  • Are you changing anything with the public API?
  • Have you tested this change on real device?
  • Are your changes backwards compatible with previous SDK Versions?
  • Have you added unit test coverage for your changes?
  • Have you verified that your changes are compatible with all the operating system version this SDK currently supports?

Manual Test Plan

Case 1: Invalid phone number

  1. Add an invalid phone number on a test app using the SDK
  2. After this request fails, send a event request using a test event
  3. This event succeeded vs. it used to fail in the past

Case 2: Invalid email
Same as above except using a invalid email instead of a phone number.

@ajaysubra ajaysubra marked this pull request as ready for review December 12, 2023 17:34
@ajaysubra ajaysubra requested a review from a team as a code owner December 12, 2023 17:34
@evan-masseau
Copy link
Contributor

Makes sense to me. I do wonder if we should do anything more than just drop it out of the queue, like emit a warning or error message. I know last spring we did discuss whether to include any kind of phone or email validation and decided to leave that up to the server at the time.

@ajaysubra
Copy link
Contributor Author

Makes sense to me. I do wonder if we should do anything more than just drop it out of the queue, like emit a warning or error message. I know last spring we did discuss whether to include any kind of phone or email validation and decided to leave that up to the server at the time.

Documenting for viz - We discussed this internally and decided to silently fail for now mainly due to not have targeted error codes from the API. We do at some point expect to retry based on more accurate error codes from the API.

Copy link
Contributor

@evan-masseau evan-masseau left a comment

Choose a reason for hiding this comment

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

LGTM, were you going to merge in the deque/dequeue branch into this one also?

@ajaysubra
Copy link
Contributor Author

LGTM, were you going to merge in the deque/dequeue branch into this one also?

Yup, was just going to address Noah comments and then go for the merge. Doing it now.

@ajaysubra ajaysubra merged commit fdf78b1 into master Dec 13, 2023
4 checks passed
@ajaysubra ajaysubra deleted the as/chnl-3841-stuck-in-bad-state branch December 13, 2023 22:25
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