Skip to content

Refactor/#62 payment#104

Merged
shinae1023 merged 4 commits into
mainfrom
refactor/#62-payment
Jun 18, 2026
Merged

Refactor/#62 payment#104
shinae1023 merged 4 commits into
mainfrom
refactor/#62-payment

Conversation

@shinae1023

@shinae1023 shinae1023 commented Jun 18, 2026

Copy link
Copy Markdown
Member

✨ 어떤 이유로 PR를 하셨나요?

  • feature 병합
  • 버그 수정(아래에 issue #를 남겨주세요)
  • 코드 개선
  • 코드 수정
  • 배포
  • 기타(아래에 자세한 내용 기입해주세요)

📋 세부 내용 - 왜 해당 PR이 필요한지 작업 내용을 자세하게 설명해주세요

  • MockQuestionCache의 questions가 ElementCollection 프록시 상태로 응답 직렬화 단계까지 전달되면서 LazyInitializationException이 발생하던 문제를 수정했습니다. 캐시 조회 및 저장 직후 questions를 List.copyOf로 복사해 서비스 계층에서 일반 리스트로 반환하도록 변경해 세션 종료 이후에도 안전하게 JSON 직렬화되도록 보완했습니다.

📸 작업 화면 스크린샷

⚠️ PR하기 전에 확인해주세요

  • 로컬테스트를 진행하셨나요?
  • 머지할 브랜치를 확인하셨나요?
  • 관련 label을 선택하셨나요?

🚨 관련 이슈 번호 [#38]

Summary by CodeRabbit

  • Refactor
    • Improved consistency in how question lists are returned from cache and generation paths to ensure data integrity across operations.

@shinae1023 shinae1023 self-assigned this Jun 18, 2026
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 12a1cff0-6c0e-4df6-b1a7-8e523caada3d

📥 Commits

Reviewing files that changed from the base of the PR and between 8824f60 and 86b4979.

📒 Files selected for processing (1)
  • src/main/java/com/jobdri/jobdri_api/domain/jobposting/service/MockQuestionCacheService.java

📝 Walkthrough

Walkthrough

MockQuestionCacheService adds a private copyQuestions(MockQuestionCache) helper that returns List.copyOf(cache.getQuestions()). Both the cached lookup path in getRecommendedQuestions and the freshly-generated path in createAndCacheQuestions are updated to return the result through this helper instead of the raw list.

Changes

Immutable Question List Copy

Layer / File(s) Summary
copyQuestions helper and all call sites
src/main/java/com/jobdri/jobdri_api/domain/jobposting/service/MockQuestionCacheService.java
Adds a private copyQuestions(MockQuestionCache) method returning List.copyOf(cache.getQuestions()). The cached-path mapping in getRecommendedQuestions and the saved-entity return in createAndCacheQuestions both switch from returning the raw list to calling this helper, aligning behavior across both code paths.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A bunny once carried her questions about,
But the list would get changed—that filled her with doubt.
So she wrapped every answer in copyOf tight,
Immutable hops from the morning till night.
"No one shall mutate my cache!" she did say,
And bounded off joyfully into the day. 🌿

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title 'Refactor/#62 payment' is unrelated to the actual changes, which involve fixing a LazyInitializationException in MockQuestionCache by implementing List.copyOf for safe JSON serialization. Update the title to reflect the actual change, such as 'Fix LazyInitializationException in MockQuestionCache by copying questions list' or 'Refactor MockQuestionCache to use List.copyOf for safe serialization'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description covers the key technical details and requirements, properly explaining the LazyInitializationException issue and the List.copyOf solution, though some checkboxes remain unchecked.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#62-payment

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@shinae1023 shinae1023 merged commit fe50d6a into main Jun 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant