Closed shane-tomlinson closed 5 years ago
@shane-tomlinson do you think this could be moved up by one train? 133 instead of 134? I guess it mostly depends on the size of this work which is unclear to me.
@shane-tomlinson do you think this could be moved up by one train? 133 instead of 134? I guess it mostly depends on the size of this work which is unclear to me.
I'm trying to get a sense of the size of this myself, one of the reasons we removed the reminders is because we were using SQL that was not safe for database replication. I'm trying to find out which calls those are and whether we have an easy path forward without leaning on another datastore.
@philbooth has expressed an interest in helping here and may have some more ideas on how to move forward.
If you want to keep the verification reminders in MySQL, write the code assuming that there's a single reader/writer and we could run it on the fxa-admin box
I forgot why we didn't redis this, but I suggest y'all redis this.
Having spent a bit of time this morning familiarising myself with all the context here, I realise the linked issue in the opening comment doesn't contain all the context. So for reference purposes...
Adding my face and moving it into active
/ train-133
, although I'm not guaranteeing that anything is going to ship this train, just yet.
I suggest y'all redis this.
Fwiw, this is what I intend to do.
Fwiw, this is what I int
👍 I hoped this.
Vague implementation plan:
Store reminders in a Redis sorted set, ordered by creation timestamp with the value as the uid
.
Run a simple script on fxa-admin
that fetches the next batch from the aforementioned sorted set, dispatching any reminder emails and deleting records as necessary. We can schedule this with cron so no need to including looping logic in the script itself.
Make sure the script has sane logic around not sending two reminders if e.g. there is an interuption to normal processing, so the first and second reminder intervals both activate in a single iteration.
@philbooth to make explicit for the vague implementation plan: reminders are only sent if the account is still unverified.
* Run a simple script on `fxa-admin` that fetches the next batch from the aforementioned sorted set, dispatching any reminder emails and deleting records as necessary. We can schedule this with cron so no need to including looping logic in the script itself.
Two questions that come to mind:
I will provide product recommendations for these. I will investigate first.
- how long do we want to wait before reminding someone?
Fwiw, defaults from config for the old implementation were 2 days before the first reminder and 7 days before the second reminder.
Per conversations this morning:
While working on this, I noticed that POST /recovery_email/verify_code
accepts some of its parameters both in the query string and in the body. That's silly and annoys me, because the only client is the content server, which we're in control of and can force to always use either one or the other.
Looking at the code, the key point is the verifyCode
method in fxa-js-client
. You can see that it always sends the data in the body, never as query params.
Thus I am hereby advertising that, included in this change, I'm also going to remove the query params from POST /recovery_email/verify_code
. If anyone has a reason it's wrong for me to do that, please let me know!
Thus I am hereby advertising that, included in this change, I'm also going to remove the query params from POST /recovery_email/verify_code. If anyone has a reason it's wrong for me to do that, please let me know!
I'm not sure why they were added as query parameters, perhaps @vladikoff or @dannycoates remember. This seems like a reasonable change to make as a standalone PR.
I'm not sure why they were added as query parameters
I think we wanted to POLL that endpoint, so a GET query param was a way to go
Polling is for /recovery_email/status
though right? I'm specifically talking just about POST /recovery_email/verify_code
here, which would only need to be sent once, when the user clicks the link in the email.
(the link itself is a GET
request of course, but that's handled by CompleteSignUpView
in the content server, which just redirects it to this POST
in the auth server)
We can use big query to ensure nobody is somehow accidentally using the queue parameters
On Thu, Mar 21, 2019 at 10:14 AM Phil Booth notifications@github.com wrote:
Polling is for /recovery_email/status though right? I'm specifically talking just about POST /recovery_email/verify_code here, which would only need to be sent once, when the user clicks the link in the email.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mozilla/fxa-auth-server/issues/2939#issuecomment-475245550, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjToj-btChKW9fQ3wtEtXCG0EHZX8Fkks5vY5PSgaJpZM4bb6G4 .
@philbooth ah POST /recovery_email/verify_code
, I cannot remember why at this time, hmm..
SELECT
*
FROM
`moz-fx-fxa-prod-0712.fxa_prod_logs.docker_fxa_auth_20190320`
WHERE
jsonPayload.fields.path LIKE "/v1/recovery_email/verify_code?%"
LIMIT
1000
...
This query returned no results.
WIP PR is at #2990.
In #2060 we removed verification reminder emails because we were using DB calls that were unsafe for replication. Let's bring the feature back using replication safe DB calls. @jbuck suggests we might be able to do this by sending events to SQS and having individual instances consume the events so that only one entry is insert per reminder.