Repository navigation
[FIX] 기록 이미지 업로드 관련 버그 수정 및 이미지만으로 기록 작성 허용 - #374
Merged
JiwonLee42 merged 12 commits intoSep 20, 2026
Merged
Conversation
@Length(max=1000)으로 검증은 통과하지만 DB 컬럼이 VARCHAR(255)라 255자 초과 기록 생성 시 INSERT가 실패해 409로 응답되던 문제를 수정한다.
수정 요청의 이미지 키를 전부 새로 insert하던 방식을 바꿔 신규 키만 추가하고, 요청에서 빠진 키만 삭제하며, 유지되는 키는 orderIndex만 갱신한다.
실제 원인 쿼리/호출 위치를 추적할 수 있도록 예외 객체를 함께 로깅한다.
JWT 기반 인증만 사용하므로 form 로그인을 끄고, 기동 시 임의 비밀번호를 생성/로깅하는 UserDetailsServiceAutoConfiguration을 제외한다.
업로드 URL 발급, R2 이미지 PUT, 기록 생성을 단계별로 측정하고 VUS, IMAGE_COUNT, CONTENT_LENGTH, PUT_MODE로 조건을 바꿔 1명/100명 등을 비교한다.
여러 실행의 report JSON을 받아 종단 소요 시간, 성공률, 단계별 응답 시간을 나란히 비교한다.
기록 생성·수정 DTO의 content @notblank를 제거하고, 내용과 이미지가 모두 비어 있는 경우에만 RECORD-400으로 거부한다. 공백 내용은 null로 저장하며 타임라인 preview는 기존 fallback("N개의 이미지")을 그대로 사용한다. 기록 수정 시 신규 이미지를 record.images에도 반영하고, 이에 맞춰 수정/중복 방지 테스트를 갱신한다.
마이페이지 닉네임/프로필 수정과 DEV 가입·로그인 DTO의 닉네임 규칙을 온보딩(최대 10자)과 맞춘다. 검증 메시지, REST Docs 설명, user.adoc 문구를 함께 갱신하고 10자/11자 경계 테스트를 추가한다.
서로게이트 문자(이모지)를 글자 단위로 세어 중간에서 깨지지 않게 자른다.
본문 전체를 preview로 저장하던 것을 앞 100자로 제한한다. 501자 이상 기록이 preview_text(VARCHAR(500)) 초과로 저장 실패하던 문제도 함께 해소된다.
조회 시 기록 본문으로 다시 계산하는 preview를 100자로 자른다. 상세 조회의 본문(content)은 자르지 않고 전체를 반환한다.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (30)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
4 tasks done
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.
📄 작업 내용 요약
사진 업로드로 독서 기록을 작성할 때 오래 걸리고 가끔 실패하던 문제를 k6 부하테스트로 재현하고, 원인이 된 서버 버그를 수정했습니다.
VARCHAR(255)라 255자 초과 시 INSERT 실패(409 "이미 존재하는 데이터") → 컬럼 확장 + Flyway 마이그레이션orderIndex만 갱신)RECORD-400)DataIntegrityViolationException로그에 스택트레이스 포함, form 로그인 및UserDetailsServiceAutoConfiguration비활성화record-image-upload시나리오와 리포트 비교 HTML 스크립트 추가📎 Issue 번호
✅ 작업 목록
user.adoc닉네임 규칙)📝 기타 참고사항
DB 마이그레이션:
V20260916_000000__widen_records_content_column.sql(records.content→VARCHAR(1000)). 컬럼 타입 확장이라 기존 데이터 재작성 없이 적용됩니다.확인이 필요한 부분
content가null로 내려갑니다.V20260904_120000__expand_record_content_length.sql이 다른 브랜치에 있는 것으로 확인됩니다(목적 동일). 그쪽이 머지되면 컬럼 확장이 중복될 수 있어 조율이 필요합니다.검증:
./gradlew test전체 통과,scripts/validate-flyway-migrations.sh통과Summary by CodeRabbit
새로운 기능
변경 사항
성능 테스트