-
Notifications
You must be signed in to change notification settings - Fork 308
Somehow record.nonce is not None #4483
Comments
Several folks have hit this. We're up to 17 events in Sentry. |
Alright, so |
... and there are no |
Alright, so what is the circumstance in which |
Hypothesis: verification restart is implicated. |
We create a nonce during |
Is |
|
The 10 that have both nonce and verified include two of the people that are definitely affected by this bug, and several others that have definitely used package claiming—including me! |
|
No!
|
|
Does that account for everyone who has claimed packages? |
We have 13 claimants of npm packages (query lifted from gratipay/inside.gratipay.com#1045):
|
Hypothesis: all 10 are people who already had a verified email and then claimed packages. The remaining three had no verified email before claiming a package. |
So I want to see everyone who has claimed a package, and what their email verification record looks like. |
|
It appears that |
So why do we have Oh! We don't. 😊
|
Alright, so the fact that |
It feels like we're not handling that case properly, that we're deleting package claims but not ... doing something else necessary. |
Is the problem that we're getting into that code path when we aren't expecting to? Or that the code path is misbehaved even when we get there properly? |
|
https://github.com/gratipay/gratipay.com/blob/2096/gratipay/models/participant/email.py#L169-L170 What about for the same participant? This will throw an |
Actually, that's protected against just before, where we load |
Gosh I really just have this hunch that what happens is that isaacs et al. are coming through the |
Because the bug manifests on |
The bug manifests here, when these three are true:
|
It feels like they should not be getting into the (I suspect the |
Isaac hit this before we deployed bulk claiming. Therefore this bug exists even with manual claiming of multiple packages, one at a time. Is that the only case where it manifests? |
Do we clear nonce on verify? Did Isaac come at us with an old nonce? |
No, not an old nonce. That was the point of #4483 (comment). Until the Recent 10, everyone is either verified or has a nonce. Only with the Recent 10 do we have both. |
Alright, I believe the If there is an existing nonce, there won't be a trace of it in the
|
So to end up with
So they must be hitting finish just before hitting start. Hmm ... 🤔 |
|
Interesting that the deltas are all over the place! |
The place where |
And |
We need to get |
My hunch is that the user is verifying their email address first, independent of package claiming, and then claiming a package using that email. |
Because they have to get into
|
30 seconds delta is about the minimum time for these two user actions. |
Perhaps they generate both emails, then click one, then click the other? |
Alright, getting into a test over here, trying to repro ... diff --git a/tests/py/test_email.py b/tests/py/test_email.py
index a964a86..f3dbfd5 100644
--- a/tests/py/test_email.py
+++ b/tests/py/test_email.py
@@ -324,6 +324,22 @@ class TestEndpoints(Alice):
)
assert response.code == 400
+ def test_find_root_cause_for_record_nonce_none_bug(self):
+ foo = self.make_package()
+ address = '[email protected]'
+
+ self.hit_email_spt('add-email', address)
+ nonce1 = self.alice.get_email(address).nonce
+
+ self.hit_email_spt('start-verification', address, package_ids=[foo.id])
+ nonce2 = self.alice.get_email(address).nonce
+
+ result1 = self.alice.finish_email_verification(address, nonce1)
+ result2 = self.alice.finish_email_verification(address, nonce2)
+
+ import pdb; pdb.set_trace()
+ assert '???'
+
class TestFunctions(Alice): |
So the hypothesis is that they hit Then ... what do they do in order to hit |
I need to get into that |
Alright, an |
Either packages claiming are deleted or they are never created in the first place. |
I'm just thinking that our verification flows might not be idempotent. We delay up to 60 seconds on send, would be quite understandable for folks to reissue a verification thinking we'd dropped the ball. |
Yes!
|
Moving to a PR in #4534 ... |
We have a sanity check during email verification, and somehow we're violating it.
The text was updated successfully, but these errors were encountered: