פרטי משתמש שנמחקו מופיעים באישור משתמש חדש

סיכום מבוסס בינה מלאכותית

A user, Dave_Olszewski, reported a bug where deleted test user info appeared during approval of a new user, due to reused user IDs and leftover records in the reviewables table. simon asked how the test user was deleted — Dave_Olszewski confirmed it was done via the UI. Later, Dave_Olszewski admitted he could not reproduce the issue and lacked detailed logs, though he preserved database records and server logs for potential analysis. sam explained that PostgreSQL sequences for user IDs are designed to only increase, making ID reuse impossible without direct database manipulation (e.g., resetting the sequence). He closed the report pending a reproducible case, inviting Dave_Olszewski to reopen it if the issue recurs with verifiable steps.

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 לייקים

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

2 לייקים

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 לייקים

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