Merging users confuses User Notes plugin and Suspension history

AI-generated summary

After merging a user with a User Note into another user, packman encountered two issues: a phantom User Note count that didn’t display any actual note, and a lingering suspension marker on the target user’s profile despite no active suspension. JammyDodger initially suggested triggering Jobs::EnsureDbConsistency, but that didn’t resolve the note issue. packman found that adding and immediately deleting a new note reset the counter to zero. For the suspension marker, JammyDodger advised temporarily upgrading the user to Trust Level 2 to reveal the “Clear Penalty History” button — which, when clicked, successfully removed the spurious suspension markers. packman confirmed this workaround worked without needing to re-suspend the user, and provided a step-by-step fix for future reference: (1) Add and delete a note to reset the counter; (2) Temporarily raise the user to TL2 if needed; (3) Use the “Clear penalty” button in the Admin screen; (4) Revert the user to their original Trust Level if upgraded. The issue appears to stem from how merging affects plugin data and penalty tracking, requiring manual intervention to restore consistency.

I merged a user who had a user note into another user with no notes. After the merge I now see the target user account having one note but when I click on the User Notes button the note doesn’t exist and I just get a chance to add a new one. How do I get the user back to zero notes count?

I think it catches up with itself when the daily background job runs. If you have access to your /sidekiq/scheduler page you can speed it up by manually triggering Jobs::EnsureDbConsistency

Unfortunately that hasn’t removed the note. I’ve also noticed that the merged user was Suspended (as an inactive user) and the target user now has a ‘1 suspension’ marker on his account but there’s noting I can do to remove the suspension marker because he isn’t really suspended.

I added a new note and deleted it which fixed the spurious note count.

The ‘1 suspension’ marker is still present. I’m wondering whether a suspension/unsuspension might fix that?

Suspend/unsuspend doesn’t work. Poor guy has 2 suspension markers now :anguished:

Actually, you’re right. I think I’m misremembering. It’s happened to me before (the user note issue) and I did exactly the same with the ‘add/remove’ in the end. :+1:

I’m not sure about the same for a suspended mark. :thinking:


I am not managing to answer quick enough :slight_smile:

Did you spot the Clear Penalty History button when the user was suspended?

You may want to try this with a test user first… :slight_smile:

But I think if you set the user in question to at least TL2 and then Suspend them, you should see a Clear Penalty History button while they’re suspended. Clicking that should wipe it back to zero, and manually unsuspending them should not increment it back up again. (:crossed_fingers:)

I’ve seen posts mentioning Clear Penalty but the user is only TL1 so I assumed it wouldn’t appear. I’ll try bumping them to TL2 and see what happens.

That worked but I didn’t need to suspend him again to see the Clear Penalty button. It just appeared once I’d set him to TL2.

For anyone finding this in future here’s what to do:

  1. Add a User Note and then delete it. After deletion the User Note counter resets to zero rather than being stuck at one.
  2. If the user is below TL2, make a note of their current TL and temporarily bump them up to TL2.
  3. On the Admin screen for the user clicking the ‘Clear penalty’ button will now remove the suspension markers.
  4. If you bumped the user to TL2 in (2) then drop them back down to their original TL