User stuck in 'staged' status

AI 生成的摘要

mcwumbly reported a bug in Discourse v1.5.0 where a user imported as a staged account remained stuck in that status after logging in via Google OAuth, preventing @mentions. Despite the email matching in the Admin UI, no UI option existed to force the user to become “unstaged”. codinghorror initially suggested deleting the account, but mcwumbly confirmed the account was unique and data was consistent. codinghorror then directed the issue to zogstrip. zogstrip provided a database workaround using a Rails console command to manually update the staged flag to false for the specific user. mcwumbly shared a broader script to automatically unstaged all users who had visited but were still marked as staged, which resolved 29 accounts in their instance. Finally, zogstrip confirmed that a permanent fix had been pushed to the repository via this commit.

I have a user whose account was originally created as a staged account via an import from another system.

Recently, they logged in and created a new topic.

But they still show up as a staged user, and I cannot @mention them.

I do not see any way in the Admin UI to force them to become “unstaged”.

Potentially relevant site settings:

  1. Google Login enabled
  2. Local logins disabled
  3. Email whitelist domains (1)

Currently running version v1.5.0.beta13b +38 (67a5fc39ded9f661974b6e06b109c75b50d3a1b1)

Can’t you delete the staged account? Sounds like the emails don’t match?

As far as I can tell there is only a single account for this user with that one email address.

On their user page in the Admin section, the “Email” field value matches the address in the “Logins” filed

eg:

Email: foo@example.com
Logins: Google(foo@example.com)

I think @zogstrip will need to have a look

1 个赞

@zogstrip feel free to reach out here or via PM if you want more details that I can help get via logs or db queries, etc.

I’ll have to try login in using the same email address using OAuth, but in the meantime, you can fix it with

cd /var/discourse
./launcher c app
User.where(email: "foo@example.com").update_all(staged: false)
1 个赞

Thanks, I have found other users in this state, so I’ll use this workaround for now…

Here’s what I’m doing to catch them all periodically:

User.where.not(previous_visit_at: nil).where(staged: true).update_all(staged: false)

This time it updated 29 users…

1 个赞

Just pushed a fix :banana:

https://github.com/discourse/discourse/commit/841f36b0589d9e5aa0bbfcd328b0c3a2d7f795b0

4 个赞

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