알림에 X 사용자 승인이 필요하다고 표시되지만 사용자가 없음

This looks like a bug, but I can’t see how to reproduce it.

I get a notification PM that says:

But when I click the review link, there are no pending users. In /admin/users I see some users that have not validated their email addresses.

I can’t tell if the notification is producing the wrong number, or if there somehow exist users waiting approval that are not showing up when searching for them, or if somehow users who haven’t validated email are getting counted as pending for notifications but not for approval.

3개의 좋아요

not to be Ms Obvious but is allow_new_registrations unchecked by chance? clearly you have the must_approve_users setting enabled and i’m not sure how that is affected if registration is disabled. :thinking: i would think the registration setting would override any account creation though and disable it. no that makes no sense either…

It’s almost certainly something obvious, so I welcome your help.

Yes, both of those are checked. Some people are getting registered and approved. It’s just that the number claimed to be waiting does not match the number claimed in the notification. It told me 5, and there had been only 2 in the past several days.

1개의 좋아요

very odd indeed. kinda sounds like something in the user registration is being rejected after the approval request is sent (counted) for review…

3개의 좋아요

Are there reviewed users when you show all reviewed items, or maybe from the staff logs? :person_shrugging:

I often got PMs/reminds of reviewable items that are already reviewed, so nothing shows up.

I asssumed that the issue was that someone else approved the users before I (or the site owner) got to them, but I can’t make the numbers add up that way).

Can a user delete their account before their registration is approved?

Maybe? I don’t think so, as they’d need to log in to do that and they can’t log in until they are approved (but I didn’t check the code or anything like that)

I found this topic while searching before filing a bug report, so adding to it.

TL;DR the query for the notification is wrong because it counts rejected users as well.

Notification: 16 users waiting for approval, click the link, see only 2.

The query used for the notification is this

puts AdminUserIndexQuery.new(query: "pending", stats: false).find_users_query.to_sql

SELECT "users".* FROM "users" 
WHERE (suspended_till IS NULL OR suspended_till <= '2023-11-13 11:05:23.225614') 
AND "users"."approved" = FALSE 
AND "users"."active" = TRUE 
ORDER BY users.created_at DESC,users.username

which, in my case, gives me 16 users

[4479, 4472, 4456, 4446, 4443, 4430, 4302, 4291, 4206, 4199, 4178, 4168, 4131, 4061, 3677, 3642]

Throwing these ids into the Reviewables queue gives me 2 users that actually need to be approved (status 0) and 14 users that have already been rejected (status 2)

ReviewableUser.where(type: 'ReviewableUser')
  .where(target_id: ids)
  .pluck(:target_id, :status)

[[3642, 2], [3677, 2], [4061, 2], [4131, 2], [4168, 2], 
[4178, 2], [4199, 2], [4206, 2], [4291, 2], [4302, 2], 
[4430, 2], [4443, 2], [4446, 2], [4456, 2], [4472, 0], [4479, 0]]
2개의 좋아요

오늘 누군가가 이 문제에 대해 불만을 제기했습니다. 이 모든 것을 찾기 전에, 저는 다음과 같은 방식으로 문제를 "해결"했습니다:

bad=User.where(approved: false);
bad.each do |user| puts "https://community.open-emr.org/admin/users/#{user.id}/#{user.username}"; end;

이 코드는 모든 사용자의 관리자 URL을 출력하므로, 거기서 승인하거나 삭제할 수 있을 것 같습니다.

그러므로 이것은 여전히 버그인 것 같습니다.

그리고 이어서:

ids=bad.pluck(:id);
ReviewableUser.where(type: 'ReviewableUser')
  .where(target_id: ids)
  .pluck(:target_id, :status)

이제 다음과 같은 결과가 반환됩니다:

=> [[4610, "rejected"], [4527, "rejected"], [4643, "rejected"], [4648, "rejected"]]

그러니까 이것들은 ReviewableUser에서 삭제해야 하는 것일까요?

아니면 그냥 사용자들을 삭제하면 될까요?

2개의 좋아요

관리자(Admin)가 아닌 모더레이터(Moderator)로서, 필터링되지 않은 검토 대기열(Review Queue)에서 거절된(Rejected) 사용자들을 나열할 수는 있었습니다. 하지만 사용자(User) 섹션에서 그들을 찾을 수 없었으며, 검토 대기열에서 거절된 사용자의 사용자 편집기(User editor)에 접근할 수도 없었습니다.

검토 대기열에 사용된 필터 파라미터는 다음과 같습니다.

https://gramps.discourse.group/review?additional_filters={}&sort_order=score&status=rejected&type=ReviewableUser

따라서 모더레이터는 사용자 탭에서 “거절(Rejected)” 및 “거부(No)” 승인 상태의 사용자를 찾을 수 있어야 하거나, 검토 대기열에서 사용자 편집기로 이동할 수 있어야 합니다.

1개의 좋아요

저도 같은 문제를 겪고 있으며, 지원팀에서 여기로 안내받았습니다.

계정에서 유일한 스태프이자 관리자입니다. 따라서 다른 관리자가 승인한 것이 아니라 확실히 이 버그로 인한 문제입니다.

세 가지 알림 모두에서 대기열을 클릭했을 때, 승인을 기다리는 사용자가 아무도 없었습니다:

2개의 좋아요

최근 신규 사용자 승인을 활성화했습니다. 신규 사용자는 매우 적으며, 이는 홍수가 아니라 작은 흐름에 불과합니다. 통지를 받고, 사용자를 승인(보통은 승인)한 후 약 1분 이내에 검토 대기열이 실제로 비어 있음에도 새로운 유령 통지가 오는 현상은 100% 재현됩니다.

어떤 레이스 컨디션(race condition)인 것 같습니다.

데이터 탐색기 쿼리를 사용하여 대기열에 보이지 않는 사용자를 찾아 해당 사용자의 관리자 페이지에서 직접 승인할 수 있습니다.

SELECT id as user_id
FROM users
WHERE approved = false
AND active = true

최근 제가 이 방법으로 처리했습니다. 또한 7일마다 이 메시지가 반복적으로 표시되었습니다. 그래서 쿼리를 사용했고 그 결과는 다음과 같습니다.

그리고 사용자 관리자 페이지에서 이를 확인했습니다.

하지만 제 경우 버튼이 작동하지 않는 이유는 아직 파악해야 합니다. 아직 자세히 살펴볼 기회가 없었습니다.
아마도 여러분에게는 버튼이 정상적으로 작동할 것입니다. 대기열에는 사용자가 없는데 이러한 알림이 발생하는 결과를 초래하는 버그가 하나 이상 있다고 생각합니다. RGJ는 거부된 사용자에 대해 무언가를 발견했고, 저는 설정이 활성화되어 있을 때 일부 기존 사용자가 승인되지 않는 경우를 보고했습니다.

저도 비슷한 경험이 있었을 수 있지만, 저의 경우 채팅과 일치하는 당신의 검색어는 사용자 외에는 아무것도 일치하지 않았습니다. 탐색기 쿼리

SELECT id as user_id
FROM users
WHERE approved = false
AND active = true

은 전혀 신규가 아닌 한 명의 사용자를 반환했습니다:

가입일 2021년 4월 9일
마지막 게시글 4월 16일
마지막 접속 4월 16일
조회수 1308
신뢰 수준 멤버

음, 수동으로 승인할 수 없습니다. 뭔가 잘못되었습니다!

수정: 저만이 아닙니다 - 이 새 토픽을 확인해 주세요: 프로필의 승인 버튼이 작동하지 않습니다

details - OT here

관리자 인터페이스에서 승인 버튼을 확인하고 클릭해도 아무 반응이 없습니다. 브라우저 콘솔에서 500 오류가 표시됩니다.

requestedUrl:
“/admin/users/332/approve”
responseText:
"<!DOCTYPE html>\n<html>\n<head>\n <title>Oops - Error 500</title>\n <meta http-equiv="Content-Type" content="text/html; charset=utf-8">\n</head>\n<body>\n <h1>Oops</h1>\n <p>The software powering this discussion forum encountered an unexpected problem. We apologize for the inconvenience…

1개의 좋아요

저희가 스타터 플랜을 사용 중이라 데이터 탐색기를 사용할 수 없기 때문에 더 걱정됩니다. 이는 승인 대기 중인 사용자가 있지만, 제가 그들을 볼 수 없을 뿐이라는 생각이 들게 합니다.

알림 메시지의 제목에 적힌 숫자보다 더 많은 사용자를 본 적은 없습니다. 메시지에 1이라고 되어 있고, 실제로도 1명만 찾았습니다.

하지만 Data Explorer를 사용하지 않더라도 승인되지 않은 사용자를 효율적으로 찾을 수 있습니다. /admin/users 화면 오른쪽 상단의 버튼을 사용하여 사용자 디렉토리를 내보낼 수 있습니다.

그리고 원하는 도구로 해당 파일을 열어 approvedfalse인 사용자를 확인하면 됩니다. 저는 Excel을 사용했는데, 실제로 사용자가 한 명뿐임을 볼 수 있습니다:

1개의 좋아요

@Moin 정말 도움이 되네요, 왜 그걸 생각하지 못했을까요?

아, 내보내기를 보니 승인되지 않은 사용자들이 실제로 있네요! 검토 페이지는 여전히 비어 있는데도요:

이것은 심각한 버그인 것 같습니다. 아무도 이 사용자들에게 연락하지 않았다면 그들은 매우 답답했을 거예요. 제가 직접 찾아서 승인하기 전에, Discourse 팀이 /review 페이지에 표시되지 않는 버그를 조사할 기회를 주겠습니다.

1개의 좋아요

그들의 계정이 활성화되었나요? 저는 가끔 이메일 주소를 아직 인증하지 않은 그런 사용자들을 몇 명 보유하기도 합니다. 그리고 이메일을 확인한 후에야 직원 승인(=시간)이 필요하도록 하는 것이 합리적입니다.