Skip to content

[Fix] 여행 기록 스티커 검증 실패 시 임시 사진 소모 방지 - #427

Merged
yeonie0309 merged 2 commits into
developfrom
fix/426-travel-record-sticker-validation
Nov 2, 2026
Merged

yeonie0309 merged 2 commits into
developfrom
fix/426-travel-record-sticker-validation

Conversation

@yeonie0309

@yeonie0309 yeonie0309 commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator

📌 PR 설명

  • 여행 기록 등록, 수정의 스티커 검증을 사진 이동 전에 수행
  • 검증 실패 후 같은 임시 사진, 원래 버전으로 재시도 가능하도록 보완

🔗 연관된 이슈

Resolves: #426

📝 리뷰 요구사항

💻 테스트 결과

  • 전체 테스트 및 빌드 통과
  • 로컬 Swagger, MySQL 정상 동작 확인

등록 스티커 검증 실패
clipboard

수정 스티커 검증 실패
clipboard

원래 버전으로 정상 수정
clipboard

Summary by CodeRabbit

  • Bug Fixes
    • Travel records now reject stickers that are unavailable, belong to another user, have been deleted, or use duplicate layer positions.
    • When sticker validation fails, temporary photos remain available, and failed record changes are not saved.
    • You can correct sticker issues and retry using the same temporary photos.
    • Updating a record without providing a sticker list preserves its existing stickers; submitting an empty list removes them.

@yeonie0309 yeonie0309 self-assigned this Nov 1, 2026
@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e7abd8a7-f970-403d-b3d4-4d268c246261
Commits

Reviewing files that changed from the base of the PR and between 42409ad and 8f0b6ba.

Files selected for processing: 2
  • src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordServiceImpl.java
  • src/test/java/com/yeogido/backend/domain/travel/service/TravelRecordStickerValidationTransactionTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Travel-record creation and update now validate sticker requests and prepare the available-sticker map before moving images. Integration tests cover invalid requests, retry behavior, and the different effects of null and empty sticker lists.

Changes: Travel record sticker validation

Layer / File(s) Summary
Validate stickers before image movement
src/main/java/com/yeogido/backend/domain/travel/service/TravelRecordServiceImpl.java, src/test/java/com/yeogido/backend/domain/travel/service/TravelRecordStickerValidationTransactionTest.java
Creation and update prepare sticker data before moving images. Update retains existing stickers when the request is null and removes them when the list is empty. Integration tests check validation failures, preserved state, and successful retries using the same temporary photo.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • yeogido/backend#421: This PR changes sticker validation in the version-checked update flow introduced by PR #421.

Suggested reviewers: yangjiae12

Merge Risk: Minimal · up to 8f0b6

The intended validation order is in place, with no identified issue requiring a fix before merge.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly describes preventing temporary photo consumption when travel-record sticker validation fails. It matches the main change.
Description check Passed The description includes the change summary, linked issue, review notes, test results, and validation evidence. It is complete enough for the repository template.
Linked Issues check Passed [#426] The create path resolves and validates stickers, checks sticker availability, and only then calls moveImages. The update path reserves the version, validates stickers against the existing pla…
Out of Scope Changes check Passed The whole-PR diff changes TravelRecordServiceImpl and adds TravelRecordStickerValidationTransactionTest. The service changes move sticker validation before photo movement and reuse the validated s…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

[#426] The create path resolves and validates stickers, checks sticker availability, and only then calls moveImages. The update path reserves the version, validates stickers against the existing placement, and only then calls moveImages. Transactional rollback restores the reserved version and existing data when validation fails. TravelRecordStickerValidationTransactionTest verifies no photo move on missing, foreign, deleted, or duplicate-zIndex stickers. It also verifies retry with the same temporary photo and original version. The test covers omitted stickers and empty-list deletion. The existing update helper behavior for retained stickers remains unchanged.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff changes TravelRecordServiceImpl and adds TravelRecordStickerValidationTransactionTest. The service changes move sticker validation before photo movement and reuse the validated sticker map. The test covers rollback, retry, validation errors, and sticker-list policies required by [#426]. No unrelated product behavior or unrelated refactoring appears.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. 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 7 functions across 2 files.

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.

Share

@yeonie0309

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@yeonie0309
yeonie0309 changed the base branch from feat/422-travel-record-delete-leave to develop November 2, 2026 06:07
@yeonie0309 yeonie0309 closed this Nov 2, 2026
@yeonie0309 yeonie0309 reopened this Nov 2, 2026

@yangjiae12 yangjiae12 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이전에 말씀드린 부분 반영된 거 확인했습니다! 수고하셨습니다~

@yeonie0309
yeonie0309 merged commit b890056 into develop Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] 여행 기록 스티커 검증 실패 시 임시 사진 소모 방지

2 participants