Strange approvals list

AI-generated summary

A user schungx reports a bug where phantom topics appear in the approvals list with no way to remove them. eviltrout identifies the issue and provides a fix via a GitHub commit. schungx seeks guidance on removing the phantom entries, and eviltrout suggests using a Rails console command to delete pending reviewable users with missing targets. schungx initially encounters issues, as ru.target.blank? evaluates to false, but resolves the problem by removing the condition. After manually deleting the two remaining entries, the approvals list is cleared. eviltrout reassures that the fix is safe and no serious damage was done.

I’m not sure what I can do on this topic… There is no Accept or Reject button, but the topic is obviously empty…

The hamburger menu shows one pending:

2 Likes

Okay this led me to discover a couple of bugs, both of which are fixed here:

https://github.com/discourse/discourse/commit/111a502231d6f46d1a85acb0cc1bff8c60c1a5e4

11 Likes

OK, how should I get rid of these phantom topics?

Rebuilding now shows these phantoms with additional fields:

But still no way to remove them…

Are you familiar with a rails console? You can clear them out with this command:

ReviewableUser.pending.each { |ru| ru.destroy if ru.target.blank? }

In plain english: if there are pending users where the user record is missing, delete them.

6 Likes

OK, two of them failed to delete.

[#<ReviewableUser:0x0000559e07933e60
  id: 1355,
  type: "ReviewableUser",
  status: 0,
  created_by_id: -1,
  reviewable_by_moderator: true,
  reviewable_by_group_id: nil,
  claimed_by_id: nil,
  category_id: nil,
  topic_id: nil,
  score: 6.0,
  potential_spam: true,
  target_id: 1964,
  target_type: "User",
  target_created_by_id: nil,
  payload: {"name"=>nil, "email"=>nil, "username"=>nil},
  version: 0,
  latest_score: Wed, 03 Apr 2019 12:39:14 UTC +00:00,
  created_at: Wed, 03 Apr 2019 12:39:14 UTC +00:00,
  updated_at: Wed, 03 Apr 2019 12:39:14 UTC +00:00>,
 #<ReviewableUser:0x0000559e07933208
  id: 1356,
  type: "ReviewableUser",
  status: 0,
  created_by_id: -1,
  reviewable_by_moderator: true,
  reviewable_by_group_id: nil,
  claimed_by_id: nil,
  category_id: nil,
  topic_id: nil,
  score: 6.0,
  potential_spam: true,
  target_id: 1965,
  target_type: "User",
  target_created_by_id: nil,
  payload: {"name"=>nil, "email"=>nil, "username"=>nil},
  version: 0,
  latest_score: Wed, 03 Apr 2019 17:03:26 UTC +00:00,
  created_at: Wed, 03 Apr 2019 17:03:26 UTC +00:00,
  updated_at: Wed, 03 Apr 2019 17:03:26 UTC +00:00>]

ru.target.blank? is false?

Alright, I removed those two phantom’s by omitting if ru.target.blank?

Now the approvals list windows is clean.

Not sure if I’ve done some ReallyBadThing™ to the system though…

You might have deleted the history of some items, but nothing serious. Glad it all got fixed in the end.

5 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.