Repository navigation
[Feat] 여행 기록 공동 편집 및 수정 충돌 방지 구현 - #421
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Update version contract src/main/java/com/yeogido/backend/domain/travel/dto/request/TravelRecordReqDTO.java, src/main/java/com/yeogido/backend/domain/travel/dto/response/TravelRecordResDTO.java, src/main/java/com/yeogido/backend/domain/travel/exception/TravelRecordErrorCode.java, src/main/java/com/yeogido/backend/domain/travel/converter/TravelRecordConverter.java, src/main/java/com/yeogido/backend/domain/travel/controller/TravelRecordController.java, src/test/java/com/yeogido/backend/domain/travel/controller/TravelRecordVisibilityApiTest.java |
Update requests require a non-negative version. Responses include the saved version, and stale versions have a 409 error code. The API description and tests cover request validation and the update payload. |
Conditional versioned save src/main/java/com/yeogido/backend/domain/travel/repository/TravelRecordRepository.java, src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordServiceImpl.java, src/test/java/com/yeogido/backend/domain/travel/controller/TravelRecordVisibilityApiTest.java, src/test/java/com/yeogido/backend/domain/travel/service/TravelRecordCoeditingTransactionTest.java, src/test/java/com/yeogido/backend/domain/travel/service/TravelRecordVisibilityIntegrationTest.java |
The repository updates a record only when its ID and version match, then increments the version. Tests cover concurrent updates, stale versions, version increments, and failed sticker updates that leave record data unchanged. |
Participant permissions and album edits src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordServiceImpl.java, src/test/java/com/yeogido/backend/domain/travel/controller/TravelRecordVisibilityApiTest.java, src/test/java/com/yeogido/backend/domain/travel/service/TravelRecordVisibilityIntegrationTest.java |
Owners can edit records at any visibility. Current participants can edit FRIENDS records, subject to sticker placement rules. Tests cover denied access, sticker retention and removal, and the six-photo limit. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant Client
participant TravelRecordController
participant TravelRecordServiceImpl
participant TravelRecordRepository
participant Database
Client->>TravelRecordController: Submit update with version
TravelRecordController->>TravelRecordServiceImpl: Call updateTravelRecord
TravelRecordServiceImpl->>TravelRecordRepository: Update fields where ID and version match
TravelRecordRepository->>Database: Increment version and save matching record
Database-->>TravelRecordRepository: Return affected row count
TravelRecordRepository-->>TravelRecordServiceImpl: Return update result
TravelRecordServiceImpl-->>TravelRecordController: Return saved record or version conflict
TravelRecordController-->>Client: Return response with saved version or conflict
Suggested reviewers: yangjiae12
Merge Risk: 
Low · up to dd728
-
A simultaneous edit can leave uploaded images unavailable for retry, requiring another upload. This is a bounded merge risk that warrants owner awareness and follow-up.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Linked Issues check
-
Explanation
이 PR은 활성 이슈
#420의코딩 요구사항을 충족합니다.updateTravelRecord는 활성 사용자 중 PRIVATE·PUBLIC 앨범의 생성자와 FRIENDS 앨범의 현재 참여자만 허용합니다. 대기·거절·탈퇴 참여자와 비활성 사용자는 테스트로 거부합니다. 요청version은 필수이며 0 이상으로 검증하고, 저장 후 버전을 응답합니다. 조건부 버전 갱신은 사진·스티커만 변경하는 경우에도 버전을 증가시키며, 충돌에는TRAVEL_RECORD4091과 409를 사용합니다. 사진 수 1~5장, 스티커 생략 유지와 빈 배열 삭제 정책, 타 참여자의 기존 커스텀 스티커 유지·편집 및 신규 무단 사용 차단을 통합 테스트가 검증합니다. 동시 갱신 승자 1건, 충돌 1건, 실패한 스티커 갱신의 메타데이터·사진 롤백도 테스트합니다.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 10 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate docstrings
-
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
yangjiae12
left a comment
There was a problem hiding this comment.
확인했습니다! 수고하셨습니다~
추가로 이번 PR에서 새로 생긴 문제는 아니지만, 사진 이동 후 스티커 검증에 실패하면 임시 사진이 이미 삭제되어 재시도가 어려울 수 있어 보입니다. 스티커 검증을 사진 이동 전에 진행하는 부분은 별도 이슈로 후속 보완해주시면 좋겠습니다!
넵 확인했습니다 감사합니다! |
📌 PR 설명
🔗 연관된 이슈
Resolves: #420
📝 리뷰 요구사항
💻 테스트 결과
참여자 수정 성공

이전 버전 충돌

공개 열람자의 수정 거부

Summary by CodeRabbit