fix: 아티클 목록 정렬 기준을 게재일(publishedAt) DESC로 변경#114
Merged
Conversation
배치 수집된 아티클은 updatedAt이 동일하여 게재일 순서가 보장되지 않았음. publishedAt DESC 정렬로 최신 게재 아티클이 상단에 표시되도록 수정. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
작업 개요
updatedAt에서publishedAt(게재일)으로 변경하여 최신 아티클이 상단에 표시되도록 합니다.변경 사항
TechArticleService.toSortedPageable(): 정렬 기준을updatedAt DESC→publishedAt DESC로 변경관련 이슈
원인 분석
아티클은 RSS 배치 크롤러로 수집되며, 같은 배치에서 수집된 아티클들은
updatedAt값이 동일합니다.이로 인해
updatedAt DESC정렬 시 같은 날 수집된 아티클들의 순서가 보장되지 않아, 실제 게재일과 무관하게 오래된 아티클이 상위에 노출되는 현상이 발생했습니다.publishedAt DESC로 변경하면 원문 블로그 게재일 기준으로 최신 아티클이 먼저 표시됩니다.TechArticle엔티티에idx_tech_article_source_published_at인덱스가 이미 존재하므로 성능 영향도 없습니다.테스트
체크리스트
API 변경 사항
GET /api/articlesGET /api/articles?page=0&size=5publishedAt내림차순)리뷰 포인트
toSortedPageable()1줄 변경으로, 리포지토리 메서드명(OrderByUpdatedAtDesc)과 실제 정렬 기준이 달라지는 점에 주목해주세요. 메서드명은 날짜 범위 필터 조건을 표현하는 역할이므로 기능 동작에 영향 없습니다. (Spring Data JPA에서 Pageable 정렬이 메서드명 정렬보다 우선 적용됩니다.)