Device counter can no longer be changed through WebUI

Bug #1071778 reported by Liam Young
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical SSO provider
Fix Released
Undecided
Unassigned

Bug Description

I have been asked to update the device counter for two different users today. On both occasions I have changed the counter to the new value and clicked save. The page appears to refresh and show the new value. However, the new value hasn't actually been updated which can be seen by querying the database or by navigating away from the users page and returning at which point the old value will be displayed.

I have only tried to update the token counter so far. I have asked mew to confirm he is seeing the same behaviour, which he is.

Related branches

Revision history for this message
Michael Foord (mfoord) wrote :

So locally, with trunk, changing the counter through admin works (and the counter is changed in the db). In fact due to the way the admin works, the value shown in the UI *comes* from the db (I believe) - so if the new value is shown then it seems unlikely that it *hasn't* been written to the db.

One possibility is a race condition? If the user is actively trying to log in whilst you are changing their account through the admin then simultaneous writes could happen (although that seems unlikely too).

Revision history for this message
Michael Foord (mfoord) wrote :

Could you try and repro this on a test account - perhaps on staging? (I don't have admin access.)

Revision history for this message
Michael Foord (mfoord) wrote :

Another possibility (more likley) is that there was some error with the form submission - so that the change was not saved. The new value would still be shown in the form but not persisted. Is it possible there was some error warning that you didn't notice?

Revision history for this message
Liam Young (gnuoy) wrote :

I have confirmed that this doesn't work in staging either and I can't see any errors being reported on the web page. I have also tested, in staging, updating "Device name" and swicthing "Twofactor required", none of these updates actually stick which I've confirmed by querying the database.

I've also noted that after clicking save I seem to remember I used to be navigated away from the account I was editing, this is not happening anymore. Instead the page seems to reload but I stay on the same page. Also, I do not see my update listed on Model Admin -> Recent Actions

Revision history for this message
Liam Young (gnuoy) wrote :

I was just able to delete an old 2fa device, in production, successfully. So it looks like some update types do still work

Revision history for this message
Liam Young (gnuoy) wrote :

pindoga has pointed out that the problem is that device type is now a mandatory field when the form is submitted,
 however, most devices don't have the device type filled in so if the device counter is updated, for example, we need to also add generic/yubi/paper/google into the device type

Revision history for this message
Ricardo Kirkner (ricardokirkner) wrote :

The problem seems to be the device_type column which is required: enter a value of "generic", "google", "yubi" or "paper" and it should work. We will work on making this field render as a dropdown combo box for convenience.

Michael Foord (mfoord)
Changed in canonical-identity-provider:
status: New → Fix Committed
Changed in canonical-identity-provider:
milestone: none → 13.03.20
Changed in canonical-identity-provider:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.