Skip to content

Allow users to opt back in to SMS (LG-3510)#5894

Merged
zachmargolis merged 53 commits intomainfrom
margolis-sms-opt-in
Feb 7, 2022
Merged

Allow users to opt back in to SMS (LG-3510)#5894
zachmargolis merged 53 commits intomainfrom
margolis-sms-opt-in

Conversation

@zachmargolis
Copy link
Contributor

@zachmargolis zachmargolis commented Feb 2, 2022

Would love some early eyes on this to make sure the direction looks good!

It's still in draft while I sort out a few things:

  • translations
  • confirm where the cancel link should go
  • make sure "choose another authentication method" link works like it's expected

Unfortunately I haven't figured out a good flow to test this locally

  • Added a test number that can always return OPT_OUT when sent to, but this means it can never be added
  • How to make it respect AWS's "only opt in once every 30 days" behavior

I have enabled the right API permissions in the sandbox so I'm going to push my branch up there and play around with it

description screenshot
first screen detecting opt out Screen Shot 2022-02-01 at 4 47 26 PM
opt in failed (already opted in w/in last 30 days) Screen Shot 2022-02-01 at 4 49 43 PM
one-off network errors Screen Shot 2022-02-01 at 4 47 39 PM

- Method was defined 4 times before, now it's only defined once
- Updated it to leverage Phonelib for better grouping of digits
  (removes USA number assumption)
@zachmargolis zachmargolis marked this pull request as ready for review February 4, 2022 04:47
@zachmargolis
Copy link
Contributor Author

This is ready for review! Just waiting on translations to come back, and then I'll add those

Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

As mentioned in original comment, a bit difficult to test, but looks good from what I can tell and what I can fake-test locally 👍

Comment on lines +183 to +184
user_session[:phone_id] = phone_configuration.id if phone_configuration&.phone
redirect_to login_two_factor_sms_opt_in_path
Copy link
Contributor

Choose a reason for hiding this comment

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

If the first line is unable to assign to the session due to a nil phone_configuration, would the redirect result in a 404?

i.e.

  • Drop the &. guarding if we're feeling confident it's there?
  • Otherwise, include the redirect in the if block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are other cases where we have :unconfirmed_phone in the session already and it still works

In an ideal world, I'd love to throw a /sms/:phone_configuration_id/opt_in in the URL to avoid this awkward session dance, but we only save confirmed phones to the DB :[

<% end %>

<%= render(
'shared/troubleshooting_options',
Copy link
Contributor

Choose a reason for hiding this comment

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

More a UX question, but I sorta wonder if the "Can't use your phone?" fallback should be folded into the list of troubleshooting options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's a case for keeping it where it is, because that one still keeps you in what you're doing, and the troubleshooting options are more like exit opportunities

Copy link
Contributor

Choose a reason for hiding this comment

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

There's several places we use in-app alternative paths with a troubleshooting options list.

e.g.

IAL2 phone confirmation "use a different phone number"

image

IAL2 "verify by mail instead"

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh those are good points... 📡🦇🌕 @nickttng! If you have any thoughts on combining links for the error page

Copy link
Contributor

Choose a reason for hiding this comment

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

@zachmargolis I think combining is a great way. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 2245973, error page looks like this now:
Screen Shot 2022-02-04 at 1 14 33 PM

Copy link
Contributor

@nickttng nickttng Feb 4, 2022

Choose a reason for hiding this comment

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

@zachmargolis Should we update "Need immediate assistance? Here's how to get help" to "Having trouble? Here's what you can do"?

With the "Choose another authentication method" text now folded into the section, the "Need immediate assistance..." might not make sense with it. And "Having trouble..." text seems to encompass more of the potential solutions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, updated in 19bd04a
Screen Shot 2022-02-04 at 1 39 38 PM

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good 👍🏼

@zachmargolis
Copy link
Contributor Author

After today's testing party, there is still some work to do before this is ready to be enabled in prod

I have disabled the feature by default in 1a731d3 and I'm going to merge it, and address the outstanding issues in future PRs to keep this PR from getting too big or too stale

@zachmargolis zachmargolis merged commit 12f214f into main Feb 7, 2022
@zachmargolis zachmargolis deleted the margolis-sms-opt-in branch February 7, 2022 20:50
@zachmargolis zachmargolis mentioned this pull request Feb 7, 2022
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.

4 participants