Deleted user info shows up in new user approval

When setting up a new Discourse with must approve users set, I discovered that after creating and then deleting a test user, the same user id was later re-used when a real user signed up, but since a row was left over in public.reviewables with the same target_id, no new row was created for this second user. The UI then listed the now-deleted username when prompting the new user to be approved.

2 Likes

How did you delete the initial test user? Was it though the Discourse user interface, or from the Rails console?

2 Likes

All of the user management was done in the UI

I haven’t been able to repro this and unfortunately I wasn’t closely recording all the steps I was following since I was just learning about operating Discourse. I do have the current records from users and reviewables tables which partially corroborate what I saw, in case there’s a clue in there, as well as the nginx and rails logs

2 Likes

We use PG sequences for user ids and they always go up. Even if you roll back a transaction the sequence will keep increasing.

It would take direct DB fiddling to break this constraint ( a reset of the id sequence on the user table for example)

I am closing this pending a repro, if you can repro this situation please flag this to be reopened.

1 Like