Staged users disappearing?


(Tobias Eigen) #1

Is it possible that staged users are deleted automatically after a while, if they don’t reply? This seems to have happened on my site with a handful of staged users from over a month ago - maybe 15 of them. I have been using staged users as part of my effort to use discourse as a ticket system, but now I am finding that the people I was writing to are gone and the messages are just to myself and there is no sign of the staged user, in the message or in the user list. I can confirm in mandrill that the email notifications were sent to the email address of the staged user.

Any insights much appreciated. :seedling:


Inviting staged users on a site with SSO enabled?
(Régis Hanol) #2

Yes, we’ll automatically remove any staged users created more than 1 year ago and who have never posted.

You should see them in the staff action logs (“delete user” action).


(Tobias Eigen) #3

Thanks, Regis! Is there an admin setting to disable this feature? I’d like to not delete them automatically. If there is none (and I couldn’t find one) could you contemplate adding it?

When they are deleted, is any shadow of a trace left behind, for example in any messages they have been in? It’s really weird to me to see messages I have written to people who are no longer in the message. Now it looks like I am schizophrenic, talking to myself and giving myself all kinds of interesting names. :wink:

Also, I think something went wrong in this case because these staged users I am talking about were created more recently, like in the last few weeks and months. None of them were created more than 1 year ago.


(Régis Hanol) #4

I could add a setting.

They’re deleted as if you clicked the Delete User button in the user admin page so standard deletion rules apply.

The code looks good to me. Would :heart: to get more info or (even better) reproduction steps :wink:


(Tobias Eigen) #6

Please do add a setting when you get a chance - this is really causing me problems. I don’t know how to replicate, but I can see that starting 27 days ago, discourse has been deleting staged users and I’m now up to 24 users deleted. Here are some examples deleted today - I replaced usernames with **DELETED**. They all seem to be 14 days old when they are deleted.

id: 4912
username: **DELETED**
name: **DELETED**
created_at: 2018-04-30 03:39:26 UTC
trust_level: 0
last_seen_at: 
last_emailed_at: 2018-05-10 11:40:53 UTC

id: 4911
username: **DELETED**
name: **DELETED**
created_at: 2018-04-30 03:31:20 UTC
trust_level: 0
last_seen_at: 
last_emailed_at: 2018-04-30 03:41:28 UTC

Could it be I am running afoul of the “purge unactivated users grace period days” setting? It was set to 14 days, and I have now set it to zero.


(Régis Hanol) #7

Most definitely. That setting controls a purge of all inactive users.


(Tobias Eigen) #8

*phew* that’s great to learn. Seems to me though that staged users should be excluded from that setting.


(Jeff Atwood) #9

I’m pretty sure these are completely unrelated things.


(Kane York) #10

Yeah, so that has been running against staged users this whole time, but it hasn’t been catching any of them because in every other usage of staged users, all the ones that are cared about have at least one post (the initial e-mail)!

The setting has been deleting things like, “someone adds a CC to a staged-user-based support PM, they get invited, never say anything” -> :wastebasket:


(Jeff Atwood) #11

LOL, go figure! :smiley_cat:


(Tobias Eigen) #12

thanks, all. the explanation makes good sense to me.

so where am I at with this? is disabling the 14 day purge of unactivated users going to fix my problem?

will you change it so in future staged users are not deleted by the 14 day purge?


(Jeff Atwood) #13

Possibly, what are your thoughts on this @sam?


(Sam Saffron) #14

The trivial fix here is to look at topic_allowed_users before doing the great 14 day purge… cause the users have records there and should be left alone. Marking this as a bug… already assigned to @zogstrip who can sort it out.


(Régis Hanol) #15

@tobiaseigen it’s now fixed :cherries:


(Régis Hanol) #16

This topic was automatically closed after 23 hours. New replies are no longer allowed.


(Arpit Jalan) #17

@codinghorror recently noticed that old inactive users were not getting purged. Turns out this was because the inactive users had a welcome message from discobot which prevented them from getting purged.

We will now purge inactive users even if they have a message from non-human users (system, discobot) as per: