Repository navigation
[Fix] 폴더 통째 삭제 전 개별 삭제됐던 자료가 폴더 복구 시 함께 부활하던 문제 수정 - #141
Conversation
|
@coderabbitai rate limit |
|
Your plan includes PR reviews subject to rate limits. More reviews will be available in 2 minutes. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough폴더 삭제 시각을 연결된 자료의 휴지통 처리에 전달합니다. 휴지통 조회, 복구, 자료 수 집계 및 상세 조회는 자료와 폴더의 삭제 시각을 비교합니다. 관련 단위 테스트와 통합 테스트를 추가했습니다. Changes폴더 휴지통 자료 처리
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/com/teaching/backend/domain/material/repository/MaterialRepository.java`:
- Around line 247-254: Update the folder restoration flow involving
restoreTrashedMaterialsByFolder so materials are restored before the folder’s
deleted_at is cleared, or pass the folder’s original deletion timestamp into the
query. Ensure the material filter compares against a non-null folder deletion
time so materials deleted with the folder are restored.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5746f310-9b1f-4a78-82f6-4d48f404fb25
📒 Files selected for processing (3)
src/main/java/com/teaching/backend/domain/folder/service/FolderService.javasrc/main/java/com/teaching/backend/domain/material/repository/MaterialRepository.javasrc/test/java/com/teaching/backend/domain/material/repository/MaterialRepositoryTest.java
… 수정 (CodeRabbit 리뷰 반영)
|
@coderabbitai rate limit |
|
Your plan includes PR reviews subject to rate limits. Reviews are available now. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
✨ 어떤 이유로 PR를 하셨나요?
📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요
폴더를 통째로 삭제했다가 복구할 때, 그 폴더 삭제 이전에 이미 개별적으로 휴지통에 있던 자료까지 함께 부활하던 문제를 수정했습니다. (PR #140의 후속 수정)
변경 사항
trashMaterialsByFolder에deletedAt파라미터 추가 — DB의CURRENT_TIMESTAMP대신 폴더 자신의 삭제 시각을 그대로 넘겨받아 저장, 캐스케이드 삭제된 자료를 명확히 식별 가능하게 함restoreTrashedMaterialsByFolder,countDeletedByFolderIdAndUserId, PR #140의countDeletedByFolderIdsAndUserId에material.deleted_at >= folder.deleted_at조건 추가 — 폴더보다 먼저 삭제된 자료는 복구/카운트 대상에서 제외findTrashedByFolderIdOrderByDeletedAtDesc/Asc)도 동일 기준 적용 — 폴더 카드의 개수와 상세 목록 개수가 항상 일치하도록findTrashedByUserIdOrderByDeletedAtDesc/Asc)은 반대로 조건을 완화 — 폴더가 같이 삭제됐어도 그 폴더보다 먼저 개별 삭제된 자료는 계속 노출되도록 함 (안 그러면 그 자료들이 휴지통 어디에도 안 보이는 새 문제가 생김)FolderService.moveFolderToTrash()가 새 시그니처에 맞춰folder.getDeletedAt()을 넘기도록 수정MaterialRepositoryTest에 회귀 테스트 2건 추가📸 작업 화면 스크린샷
🚨 관련 이슈 번호 [ ]
Summary by CodeRabbit
버그 수정
테스트