# DM에서 제외된 후 안 읽음 알림이 사라지지 않아요

**URL:** https://meta.discourse.org/t/cant-clear-unread-notification-after-being-removed-from-a-pm/311995
**Category:** Bug
**Tags:** personal-messages, fixed
**Created:** [6월 13, 2024, 9:17오후 UTC](https://meta.discourse.org/t/cant-clear-unread-notification-after-being-removed-from-a-pm/311995 "2024-06-13T21:17:31Z")
**Posts on this page:** 1
**Showing post:** 23

<div class="post-metadata">

### Author: ![tannerabread](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tannerabread/32/526153_2.png) [@tannerabread](https://meta.discourse.org/u/tannerabread)
#### Post date: [8월 12, 2026, 5:55오후 UTC](https://meta.discourse.org/t/cant-clear-unread-notification-after-being-removed-from-a-pm/311995/23 "2026-08-12T17:55:58Z")

</div>

> [@Moin](#):
>
> 이 이슈가 열려 있는 지 꽤 시간이 지났습니다. 이 작업에 필요한 다른 것이 있나요, 아니면 단순히 검토하고 병합할 시간이 없었던 건가요?

이 작업은 진행 중이던 시점에 해당 영역에서 많은 변경 사항이 동시에 이루어지면서 상당히 지연되었습니다. 그 PR들은 부활시키기에는 너무 오래된 상태가 되었고, 또한 해당 영역에서 모든 변경 사항을 만든 사람이 저였기 때문에 제가 이 지연의 원인이 된 것도 알게 되었습니다. 그래서 이 작업을 제가 맡아 수정 사항을 병합했습니다.

> <https://github.com/discourse/discourse/pull/42418>
>
> The notification list Guardian-filters inaccessible topics, but the unread-badge… counter (raw SQL COUNT) does not. When a user lost PM access, stale notification rows kept inflating the badge — the menu showed nothing new, but the count wouldn't clear.
> 
> Discourse already has \`Jobs::DeleteInaccessibleNotifications\` (used by \`TopicConverter\` and \`PostMover\`). This PR:
> 
> \- Wires it into \`Topic#remove\_allowed\_user\` (inline, Guardian-guarded so users with group-based access are preserved), \`Topic#remove\_allowed\_group\`, and \`GroupManager#remove/bulk\_remove\`.
> \- Narrows the \`GroupManager\` enqueue to topics where removed users actually have notifications, and passes \`user\_ids\` so the job scopes its work — prevents fan-out when a large group sits on many PMs.
> \- Rewrites the job: Guardian-check once per user (not per notification), single batched \`delete\_all\`, one publish\_notifications\_state\` per user.
> \- Adds a post-deploy backfill migration to clean up existing orphaned PM notifications.
> 
> Category-permission, trust-level, and direct \`GroupUser#destroy\` paths (SSO, auto-groups) are left as follow-ups.
> 
> \[\`/t/311995\`\](https://meta.discourse.org/t/cant-clear-unread-notification-after-being-removed-from-a-pm/311995)
> \[\`/t/384961\`\](https://meta.discourse.org/t/sticky-unread-reply-notification/384961)

> [@Moin](#):
>
> 이것이 [Sticky unread reply notification](https://meta.discourse.org/t/sticky-unread-reply-notification/384961) 도 함께 수정될 것 같습니다.

그렇다고 믿고 있으며, 현재 여전히 깨져 있는 상태인지도 확신이 서지 않습니다. 어쨌든, 이 병합 이후 ~~반드시~~ 수정될 것입니다.

---

_[View the full topic](https://meta.discourse.org/t/cant-clear-unread-notification-after-being-removed-from-a-pm/311995)._
