Repository navigation
fix: 쓰지 않는 사진 파일을 지우고 검증 구멍과 낡은 문서를 정리한다 - #123
Merged
Merged
Conversation
🤖 Gemini PR Review분석 결과 실제 수정이 필요한 문제가 발견되었습니다. 아래 내용을 확인해 주세요. 1. [HIGH]
|
SD-gif
added a commit
that referenced
this pull request
Sep 17, 2026
main 에 들어온 '게시물 수정으로 빠진 사진 파일 정리'(#123)와 겹친다. 그쪽은 요청의 원본 주소에 없는 딸린 파일을 지우는데, 축소본이 생기면서 딸린 파일 주소에 축소본이 함께 들어온다. 그대로 두는 사진의 축소본까지 지워져 목록 사진이 깨지므로, 남길 목록에 요청의 thumbnailUrl 도 넣는다. Co-Authored-By: Claude Opus 5 <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.
변경 내용
커뮤니티 쪽 오류·낭비를 잡고 낡은 문서를 지금 동작에 맞췄다. 기능 추가는 없다.
1. 게시물 수정으로 빠진 사진이 저장소에 영원히 남았다
PATCH /posts/{postId}로mediaList를 교체하면 DB 행만 지우고 S3 파일은 남겨 뒀다.고아 파일 정리는 한 번도 게시물에 붙지 않은 파일만 보므로, 붙었다 빠진 파일은 아무도
지우지 않는다.
MediaFileRemover를 추가해 커밋된 뒤에 지운다. 트랜잭션 안에서 지우면뒤이어 롤백됐을 때 파일만 사라져 사진이 깨진 글이 남는다. 만료 게시물 정리가 이미 같은
방식이다. 파일을 못 지워도 수정은 성공하며, 같은
url을 다시 보낸 사진은 남긴다.2. 검증 구멍 두 곳
PATCH /users/me/profile-imageGET /posts/me/deletedsize를 조용히 50 으로 줄임400프로필 사진 URL 은 피드·댓글·팔로워·알림 응답에 모두 실려 나가, 상한이 없으면 한 사용자가
목록 응답 크기를 좌우한다. 본문 2000자 상한과 같은 이유인데 여기만 빠져 있었다.
size는 문서가 이미 "1~50, 넘기면 400" 이라 적고 있어 코드를 문서에 맞췄다.3. 코드 정리
CommentService.likedCommentIds의@Transactional제거. private 메서드라 프록시가걸지 못해 아무 일도 하지 않았다. 주석도
update()설명이 복사돼 있었다.CommentService의 페이지 크기 상수 두 개를Paging으로 통일.4. 문서 정정
자유 입력 해시태그 시절 설명이 남아 있었고, 아래 둘은 지금 동작과 정반대다.
수만 줄인다. 연결까지 지우면 무엇을 골랐는지 되짚을 근거가 사라진다.
categories로 고르며 본문과 무관하다.ERD.md24절의 "#뒤의 한글·영문만 인정", "게시물당 20개·태그당 50자"(실제 10개)도고치고, 테이블 이름이
hashtags인 이유와AdminStatsService가 네이티브 SQL 로 이이름을 쓴다는 사실을 적어 뒀다.
영향
API 변경 없음
요청·응답 형식은 그대로다. 정상 범위의 요청은 동작이 같고, 상한을 넘기던 요청만
400이된다.
ERD.md는 24절 설명만 고쳤고 스키마·migration 변경은 없다. 외부 API 중에는 S3 만관계있으며, 삭제 호출이 게시물 수정 경로에 추가된다. 저장소가 꺼져 있으면 아무것도 하지
않는다.
테스트