Topic List Previews (legacy)

안녕하세요, 훌륭한 플러그인 감사합니다!

불행히도, 마지막 업데이트 이후로 Discourse에 직접 호스팅되지 않은 이미지들이 Grid 또는 Tiles 뷰에 더 이상 표시되지 않습니다. 확인해 주실 수 있을까요?

예를 들어, 게시물에 다른 서버(blogger, picasa, …)에서 가져온 이미지가 있는 경우 더 이상 표시되지 않습니다. 이전에는 아무 문제 없이 잘 작동했습니다.

1개의 좋아요

썸네일은 이제 Discourse 코어에서 생성되며, 저는 이에 대해 거의 영향을 미칠 수 없습니다.

썸네일 생성 로직의 대부분이 제거되어 Discourse에 위임되었습니다.

다음 링크에서 해당 사항을 언급해 보시는 것이 좋습니다: Theme modifiers: A brief introduction

2개의 좋아요

감사합니다! 거기에 답변을 남겼습니다. 모든 이미지가 로컬 서버에 호스팅되지 않아서 업데이트에 대해 조금 회의적인 입장입니다.

2개의 좋아요

설정값을 통해 'uploads’를 원격 서버에 호스팅하는 경우에도 여전히 작동할 것이라고 생각합니다. 다만, 더 이상 원격 사이트나 비관련 제3자에게 핫링크를 하지 않습니다.

이 부분은 이제 코어에서 처리되므로, 플러그인에서 이 코드베이스의 해당 부분을 관리하는 것은 더 이상 의미가 없습니다. 해당 팀에게 후속 조치를 요청하는 것이 완전히 옳습니다. :+1:

4개의 좋아요

감사합니다. 상황을 이해했습니다. 저희 사이트는 이미지가 다른 서버에 호스팅되어 있어, 쉽게 해결할 수 있는 문제가 아닙니다. 게시글이 많은 상황에서 제휴 서버로 이전하는 것은 너무 복잡하고, 로컬 서버에 호스팅하기에는 용량이 너무 큽니다.

1개의 좋아요

제가 겪고 있는 문제는, 앞서 논의했듯이 이벤트 플러그인이 활성화되면 모바일에서 섬네일이 더 이상 표시되지 않는다는 점입니다. 이것이 당신이 언급하신 내용이라고 생각했습니다.

저에게는 썸네일이 정상적으로 표시됩니다. @fzngagan 님이 안내한 대로 Events를 업데이트했는지 확인해 보셨나요?

2개의 좋아요

제가 테스트를 마친 직후에 바로 머지했을 것 같아요. 도와주셔서 감사합니다. 이제 모두 정상적으로 작동합니다!

3개의 좋아요

어제 업데이트를 한 후 성능이 상당히 떨어지고 있습니다. 프로파일러를 살펴보니 TLP의 이 쿼리가 문제인 것 같습니다. 혹시 인덱스가 누락된 건가요?

흥미롭게도, 사이트를 안전 모드에서 실행해도 이 쿼리가 여전히 나타납니다. :thinking:

1개의 좋아요

기능 이미지. 이 쿼리는 정말 오래(몇 년 전부터) 변경되지 않았습니다. 이 문제가 정말 새로운 이슈인지 확인해 보셨나요?

태그 생성일 기준으로 정렬하고 계신가요? 그렇다면 거의 필연적으로 복잡한 쿼리가 될 것입니다. 최신순 정렬을 사용하는 것이 더 나은 선택일 수 있습니다.

일시적으로 이 기능을 끄실 수 있습니다.

테마 컴포넌트는 코어 API를 사용합니다. 만약 이 기능이 문제를 일으키고 있다면, 일시적으로 코어 API를 직접 사용하도록 전환해 보실 수 있습니다.

1개의 좋아요

PG12로 업그레이드한 이후에 생긴 문제인 것 같습니다. 그리고 태그 생성일 기준으로 정렬하는 기능은 우리 커뮤니티의 핵심 ‘기능’이라 꼭 필요합니다. TC로 전환하면 어떤 점을 놓치게 될까요?

참고로: 몇 년 전에 당신과 함께 피처드 행에 대해 동일한 문제를 논의했던 기억이 약간 있습니다. 좀 더 찾아보겠습니다.

2개의 좋아요

PG 12 업그레이드가 재인덱싱을 완료했는지 확인해 보셨나요? 해당 프로세스가 진행되는 동안 성능 저하가 발생했다는 사용자 보고가 많았으며 (그 보고들은 TLP와 관련이 없었습니다).

참고로, 다시 생각해 보니 다른 부분도 변경되었을 수 있습니다. 지금은 topic_thumbnails과 조인(join)해야 하지만, 그건 꽤 오래전 일이고 그 이후로 다른 보고는 없었습니다. 이전에 Topic 객체에서 image_url 핫링크를 사용했을 가능성이 있으며, 그러면 더 빠를 것 같습니다(조인이 하나 적으므로). 하지만 코어 변경으로 인해 이제 그 방식은 사용할 수 없습니다. 이것이 원인에 기여하고 있을 수 있습니다.

1개의 좋아요

네, 재인덱싱이 완료되었습니다. 주제 생성 날짜 기준으로 정렬할 때도 동일한 문제가 발생합니다. 두 쿼리의 EXPLAIN 출력 결과는 다음과 같습니다:

태깅 날짜 기준 정렬:

discourse=# explain SELECT "topics"."id", "topics"."title", "topics"."last_posted_at", "topics"."created_at", "topics"."updated_at", "topics"."views", "topics"."posts_count", "topics"."user_id", "topics"."last_post_user_id", "topics"."reply_count", "topics"."featured_user1_id", "topics"."featured_user2_id", "topics"."featured_user3_id", "topics"."deleted_at", "topics"."highest_post_number", "topics"."like_count", "topics"."incoming_link_count", "topics"."category_id", "topics"."visible", "topics"."moderator_posts_count", "topics"."closed", "topics"."archived", "topics"."bumped_at", "topics"."has_summary", "topics"."archetype", "topics"."featured_user4_id", "topics"."notify_moderators_count", "topics"."spam_count", "topics"."pinned_at", "topics"."score", "topics"."percent_rank", "topics"."subtype", "topics"."slug", "topics"."deleted_by_id", "topics"."participant_count", "topics"."word_count", "topics"."excerpt", "topics"."pinned_globally", "topics"."pinned_until", "topics"."fancy_title", "topics"."highest_staff_post_number", "topics"."featured_link", "topics"."reviewable_score", "topics"."image_upload_id" 
discourse-# FROM "topics" 
discourse-# INNER JOIN "topic_tags" 
discourse-# ON "topic_tags"."topic_id" = "topics"."id" 
discourse-# INNER JOIN "tags" ON "tags"."id" = "topic_tags"."tag_id" 
discourse-# WHERE ("topics"."deleted_at" IS NULL) 
discourse-# AND "topics"."visible" = TRUE 
discourse-# AND (NOT topics.closed AND NOT topics.archived AND topics.deleted_at IS NULL) 
discourse-# AND (topics.image_upload_id in (
discourse(#         SELECT image_upload_id FROM topic_thumbnails
discourse(#       ))
discourse-# AND (tags.id IN (1)) 
discourse-# 
discourse-# ORDER BY (
discourse(#  SELECT created_at FROM topic_tags
discourse(#         WHERE topic_id = topics.id
discourse(#         AND tag_id IN (1)
discourse(#         LIMIT 1
discourse(# )
discourse-# 
discourse-# DESC LIMIT 6; 
                                                                    QUERY PLAN                                                         
            
---------------------------------------------------------------------------------------------------------------------------------------
------------
 Limit  (cost=2631719.94..2631719.95 rows=6 width=569)
   ->  Sort  (cost=2631719.94..2631721.73 rows=717 width=569)
         Sort Key: ((SubPlan 1)) DESC
         ->  Nested Loop  (cost=0.43..2631707.09 rows=717 width=569)
               ->  Seq Scan on tags  (cost=0.00..4.51 rows=1 width=4)
                     Filter: (id = 1)
               ->  Nested Loop  (cost=0.43..2625737.13 rows=717 width=565)
                     ->  Seq Scan on topic_tags  (cost=0.00..860.33 rows=1539 width=8)
                           Filter: (tag_id = 1)
                     ->  Index Scan using topics_pkey on topics  (cost=0.43..1705.57 rows=1 width=561)
                           Index Cond: (id = topic_tags.topic_id)
                           Filter: ((deleted_at IS NULL) AND visible AND (NOT closed) AND (NOT archived) AND (deleted_at IS NULL) AND (
SubPlan 2))
                           SubPlan 2
                             ->  Seq Scan on topic_thumbnails  (cost=0.00..2966.64 rows=171664 width=8)
               SubPlan 1
                 ->  Limit  (cost=0.29..8.31 rows=1 width=8)
                       ->  Index Scan using index_topic_tags_on_topic_id_and_tag_id on topic_tags topic_tags_1  (cost=0.29..8.31 rows=1
 width=8)
                             Index Cond: ((topic_id = topics.id) AND (tag_id = 1))
 JIT:
   Functions: 25
   Options: Inlining true, Optimization true, Expressions true, Deforming true
(21 rows)

주제 날짜 기준 정렬:

discourse=# explain SELECT "topics"."id", "topics"."title", "topics"."last_posted_at", "topics"."created_at", "topics"."updated_at", "topics"."views", "topics"."posts_count", "topics"."user_id", "topics"."last_post_user_id", "topics"."reply_count", "topics"."featured_user1_id", "topics"."featured_user2_id", "topics"."featured_user3_id", "topics"."deleted_at", "topics"."highest_post_number", "topics"."like_count", "topics"."incoming_link_count", "topics"."category_id", "topics"."visible", "topics"."moderator_posts_count", "topics"."closed", "topics"."archived", "topics"."bumped_at", "topics"."has_summary", "topics"."archetype", "topics"."featured_user4_id", "topics"."notify_moderators_count", "topics"."spam_count", "topics"."pinned_at", "topics"."score", "topics"."percent_rank", "topics"."subtype", "topics"."slug", "topics"."deleted_by_id", "topics"."participant_count", "topics"."word_count", "topics"."excerpt", "topics"."pinned_globally", "topics"."pinned_until", "topics"."fancy_title", "topics"."highest_staff_post_number", "topics"."featured_link", "topics"."reviewable_score", "topics"."image_upload_id" FROM "topics" INNER JOIN "topic_tags" ON "topic_tags"."topic_id" = "topics"."id" INNER JOIN "tags" ON "tags"."id" = "topic_tags"."tag_id" WHERE ("topics"."deleted_at" IS NULL) AND "topics"."visible" = TRUE AND (NOT topics.closed AND NOT topics.archived AND topics.deleted_at IS NULL) AND (topics.image_upload_id in (
        SELECT image_upload_id FROM topic_thumbnails
      )) AND (tags.id IN (1)) ORDER BY (SELECT created_at FROM topic_tags
        WHERE topic_id = topics.id
        AND tag_id IN (1)
        LIMIT 1)
        DESC LIMIT 6; 
                                                                    QUERY PLAN                                                         
            
---------------------------------------------------------------------------------------------------------------------------------------
------------
 Limit  (cost=2631719.94..2631719.95 rows=6 width=569)
   ->  Sort  (cost=2631719.94..2631721.73 rows=717 width=569)
         Sort Key: ((SubPlan 1)) DESC
         ->  Nested Loop  (cost=0.43..2631707.09 rows=717 width=569)
               ->  Seq Scan on tags  (cost=0.00..4.51 rows=1 width=4)
                     Filter: (id = 1)
               ->  Nested Loop  (cost=0.43..2625737.13 rows=717 width=565)
                     ->  Seq Scan on topic_tags  (cost=0.00..860.33 rows=1539 width=8)
                           Filter: (tag_id = 1)
                     ->  Index Scan using topics_pkey on topics  (cost=0.43..1705.57 rows=1 width=561)
                           Index Cond: (id = topic_tags.topic_id)
                           Filter: ((deleted_at IS NULL) AND visible AND (NOT closed) AND (NOT archived) AND (deleted_at IS NULL) AND (
SubPlan 2))
                           SubPlan 2
                             ->  Seq Scan on topic_thumbnails  (cost=0.00..2966.64 rows=171664 width=8)
               SubPlan 1
                 ->  Limit  (cost=0.29..8.31 rows=1 width=8)
                       ->  Index Scan using index_topic_tags_on_topic_id_and_tag_id on topic_tags topic_tags_1  (cost=0.29..8.31 rows=1
 width=8)
                             Index Cond: ((topic_id = topics.id) AND (tag_id = 1))
 JIT:
   Functions: 25
   Options: Inlining true, Optimization true, Expressions true, Deforming true
(21 rows)
2개의 좋아요

도움이 되네요. 감사합니다.

언제 처리할 수 있을지 잘 모르겠습니다.

또한, 새로운 조인(join)이 개선될 수 있다는 점도 염두에 두세요. 하지만 제거할 수 없어요. (아, 맞다! 할 수 있겠네요!)

1개의 좋아요

OK, @bartv와 오프라인으로 협력하여 이를 개선했습니다.

이 문제는 플러그인에만 영향을 미치며, TC에는 영향을 주지 않습니다:

https://github.com/paviliondev/discourse-topic-previews/pull/158

Featured Images를 사용하는 사이트에는 큰 개선 사항이므로 업그레이드를 권장합니다.

5개의 좋아요

당신은 록스타예요! :guitar:

3개의 좋아요

바트, 너의 상세한 탐정이 정말 중요했어. 고마워.

3개의 좋아요

안녕하세요, 컨테이너의 app.yml 파일에 git clone URL을 추가했는데, 앱을 다시 빌드하면 다음과 같은 오류가 발생합니다:

(<unknown>): found a tab character that violate indentation while scanning a plain scalar at line 91 column 13 -e LANG=en_US.UTF-8

그리고 웹사이트가 작동하지 않았습니다.

플러그인의 git clone URL을 삭제하니 다시 정상적으로 작동합니다.

1개의 좋아요

이 문제가 해당 플러그인만의 문제는 아닐 것 같습니다. app.yml 파일에서는 탭을 사용할 수 없으며, 공백을 사용해야 합니다.

2개의 좋아요

네, 죄송합니다. 플러그인의 최신 줄을 복사해서 붙여넣고 git clone URL을 변경했습니다. 이제 작동합니다. 감사합니다 :slight_smile:

2개의 좋아요