# 요약 메일 항목이 여러 번 반복됩니다

**URL:** https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539
**Category:** Bug
**Tags:** activity-summary, fixed
**Created:** [2월 23, 2024, 8:38오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539 "2024-02-23T20:38:35Z")
**Posts on this page:** 11
**Page:** 2

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [9월 25, 2024, 4:08오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/27 "2024-09-25T16:08:23Z")

</div>

다음은 방금 유휴 상태의 테스트 사용자 계정으로 발송된 또 다른 다이제스트입니다:

- 마지막 확인: 2024-09-12
- 다이제스트 주기: 매일
- “요약 이메일에 신규 사용자의 콘텐츠 포함”: 체크됨
- 음소거된 관련 태그 없음

### 인기 주제:

“AI - 더 큰 것이 더 나은가?” – 3회 반복. 주제에 태그 3개, 답변 0개, 좋아요 0개.  
“사회공학(소셜 엔지니어링) 과제” – 2회 반복. 주제에 태그 2개, 답변 1개, 좋아요 0개.

### 당신을 위한 새로운 소식:

“새로운 태그 요청” – 반복되지 않음. 주제에 태그 0개, 답변 0개, 좋아요 0개.

 ![2024-09-25-digest-screenshot](https://global.discourse-cdn.com/meta/original/4X/d/a/c/dacecf3141c29fde44059e996630276680f9155e.png)

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [9월 25, 2024, 5:54오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/28 "2024-09-25T17:54:05Z")

</div>

최근 받은 다이제스트 중 하나에서는 주제 중 어떤 것도 중복되지 않았지만, 주제 아래에 있는 댓글(인기 게시물)은 중복되었습니다. 자리는 5개였고, 그중 2개가 중복되어 고유한 게시물은 3개였습니다. 중복된 두 게시물 모두 동일한 주제에서 비롯되었습니다.

수정: 다른 테스트/관리자 계정으로 발송된 과거 다이제스트를 살펴보고 있습니다:

- 이전 다이제스트에도 인기 게시물에 동일한 주제에서 비롯된 중복 항목이 2개 있었습니다.
- 그보다 이전 다이제스트에는 중복된 주제가 있었지만, 인기 게시물에는 중복이 없었습니다. 대신 ‘당신에게 새로운 것’ 섹션에 중복 항목이 있었습니다.
- 그보다 이전 다이제스트에는 중복 항목이 전혀 없었습니다.

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [9월 25, 2024, 8:28오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/29 "2024-09-25T20:28:30Z")

</div>

@j127, 다이제스트 토픽에 몇 개의 태그가 붙어 있었는지 궁금합니다. 최근 샘플을 살펴본 결과, 중복은 토픽의 태그 수와 비례하는 경향이 있습니다. 우연일 수도 있고, 아닐 수도 있겠네요.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [9월 25, 2024, 8:47오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/30 "2024-09-25T20:47:55Z")

</div>

> [@ToddZ](#):
>
> 다이제스트 태그 억제 – 개인 태그 1개 (다이제스트에서 올바르게 억제되는 것으로 보입니다

> [@ToddZ](#):
>
> 최근 샘플에서 중복은 주제에 있는 태그 수와 일치합니다.

`digest suppress tags` 사이트 설정에 태그를 추가하고 여러 태그가 있는 주제를 생성하여 로컬 Discourse 사이트에서 문제를 재현할 수 있었습니다.

다음 코드가 문제의 원인입니다: [discourse/app/models/topic.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/app/models/topic.rb#L605-L614)

```ruby
    if SiteSetting.digest_suppress_tags.present?
      tag_ids = Tag.where_name(SiteSetting.digest_suppress_tags.split("|")).pluck(:id)
      if tag_ids.present?
        topics =
          topics.joins("LEFT JOIN topic_tags tg ON topics.id = tg.topic_id").where(
            "tg.tag_id NOT IN (?) OR tg.tag_id IS NULL",
            tag_ids,
          )
      end
    end

```

수정: 여기에는 `LEFT JOIN`이 필요하지 않은 것 같습니다. 조인된 `topic_tags` 테이블의 컬럼은 메서드 후반부에서 사용되지 않는 것으로 보입니다. 수정 방법은 다음과 같이 간단할 수 있습니다:

```ruby
if SiteSetting.digest_suppress_tags.present?
tag_ids = Tag.where_name(SiteSetting.digest_suppress_tags.split("|")).pluck(:id)
  if tag_ids.present?
  topics =
    topics.where.not(id: TopicTag.where(tag_id: tag_ids).select(:topic_id))
  end
end

```

최선의 접근 방식은 Discourse 팀이 결정하도록 맡기겠습니다. `for_digest` 메서드는 매우 자주 실행되므로 효율적이어야 합니다.

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [9월 25, 2024, 8:51오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/31 "2024-09-25T20:51:31Z")

</div>

네, 모든 중복 게시글에는 두 개의 태그가 있었습니다.

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [9월 25, 2024, 10:11오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/32 "2024-09-25T22:11:18Z")

</div>

@simon – 이 문제를 찾아내 주셔서 정말 감사합니다! 😃 많은 자료를 살펴봐야 했을 텐데요. Discourse 팀이 돌아와서 분석 결과를 바탕으로 조치를 취하는 것을 기대하고 있습니다.

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [9월 26, 2024, 6:12오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/33 "2024-09-26T18:12:48Z")

</div>

`digest suppress tags`에 있던 태그를 제거하니 요약이 정상으로 돌아왔음을 확인합니다. (그동안 `digest suppress categories`를 사용하고 있습니다.)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [10월 31, 2024, 2:57오후 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/37 "2024-10-31T14:57:59Z")

</div>

@simon 님의 말씀이 맞았습니다 👍 실제로 그 부분이 버그였네요

> <https://github.com/discourse/discourse/pull/29517>
>
> When using the \`digest\_suppress\_tags\` site setting to list some tags that should… be removed from the digests, if there was a topic that had one suppressed tag and other regular tag(s), it would be duplicated in the summaries.
> 
> https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539
> 
> Thanks to @scossar for \[figuring it out\](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/30).

---

<div class="post-metadata">

### Author: ![ToddZ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/toddz/32/328350_2.png) [@ToddZ](https://meta.discourse.org/u/ToddZ)
#### Post date: [11월 2, 2024, 12:17오전 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/39 "2024-11-02T00:17:33Z")

</div>

좋은 소식입니다! 😃

병합된 커밋이 베타 채널에서 언제부터 사용 가능한지 정확히 파악이 안 됩니다. 현재 3.4.0.beta3-dev (53f9c81790) 버전을 사용 중인데 GUI 업데이트를 요구하지 않는다면, 커맨드라인 업데이트를 통해 이 변경 사항을 받을 수 있을까요?

---

<div class="post-metadata">

### Author: ![Firepup650](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/firepup650/32/465200_2.png) [@Firepup650](https://meta.discourse.org/u/Firepup650)
#### Post date: [11월 2, 2024, 2:05오전 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/40 "2024-11-02T02:05:43Z")

</div>

프롬프트 없이 UI를 가져올 수도 있고, 그러면 새로운 커밋도 함께 가져옵니다. 하지만 CLI로 재빌드하는 경우에도 커밋이 가져와집니다.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [11월 4, 2024, 7:00오전 UTC](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539/41 "2024-11-04T07:00:40Z")

</div>

이 주제는 3일 후 자동으로 닫혔습니다. 더 이상 새 답글을 작성할 수 없습니다.

[이전 페이지](https://meta.discourse.org/t/multiple-repeated-summary-mail-entries/296539.md?page=1)
