Uncaught UnexpectedValueException
error / unnecessary users in DB
#203
Milestone
Uncaught UnexpectedValueException
error / unnecessary users in DB
#203
Problem
I noticed this error in the logs:
Full log in Slack
/archives/G02QB4059/p1685257590345359
.3
other instances if you search forUnexpectedValueException
.I also noticed that the
2fa_webauthn_users
table has12k
rows, but only a handful of users have created credentials so far. It doesn't seem like there should be a row for the user unless they create a credential; otherwise it could take up a lot of unnecessary space it if ends up creating an entry for every user who logs in after #153 was deployed.Relevant code
wporg-two-factor/settings/rest-api.php
Line 214 in e426735
https://github.com/sjinks/wp-two-factor-provider-webauthn/blob/a17ed697a218741986198366217d4e73daa4403f/inc/class-webauthn-credential-store.php#L93
https://github.com/sjinks/wp-two-factor-provider-webauthn/blob/a17ed697a218741986198366217d4e73daa4403f/inc/class-webauthn-user.php#L54
Next steps
We need to understand why
get_user_keys()
ends up creating a handle for every user, even if they don't have a key yet. @sjinks, can you give some insight there?https://github.com/sjinks/wp-two-factor-provider-webauthn/blob/a17ed697a218741986198366217d4e73daa4403f/inc/class-webauthn-user.php#L42-L51
If that functionality is not needed, then maybe we can short-circuit it somehow. That should avoid the error and the extra users.
If it is needed, then we need to figure out why it works most of the time, but fails every so often.
The text was updated successfully, but these errors were encountered: