Skip to content

Fix : 공지사항 알림 전송 시 ID 추가 간 NPE 발생 문제 수정#341

Merged
rlagkswn00 merged 6 commits intodevelopfrom
fix/add-id-to-notice-message
Feb 13, 2026
Merged

Fix : 공지사항 알림 전송 시 ID 추가 간 NPE 발생 문제 수정#341
rlagkswn00 merged 6 commits intodevelopfrom
fix/add-id-to-notice-message

Conversation

@rlagkswn00
Copy link
Member

#️⃣ 이슈

#333

📌 요약

🛠️ 상세

현재 상황

  1. 공지사항 스크랩 후 DB저장(BatchInsert)
  2. NoticeMessageDto 생성 간 Notce.getId() 수행
  3. 하지만, id값이 존재하지 않아 NPE발생.

이 PR에서 수정한 사항

  • JdbcTemplate BatchInsert를 JpaRepository saveAll()로 변경했습니다.

💬 기타

생각하게된 과정..

  • 기존에 Batch 처리를 유지하는게 맞다고 판단해서 초기에는 저장 후 다시 조회하는 식으로 구현했습니다. 조회하려고 하니 PK가 아닌 후보키를 찾는게..? 적절한 방법이 없다고 생각했습니다.
  • 그나마 찾으면 articleId인데, articleId를 PK처럼 쓰지 말자고 저번 회의때 이야기 했기에, 이또한 적절치 않다고 판단했습니다.
  • 그렇담 saveAll로 했을 때 무수히 발생하는 단건 insert들이 얼마나 발생할까를 고민해봤을 때 과거 내역을 살펴보니 1 스케쥴링 당 많아야 10번 ~ 20번 정도의 범위에 포함된다고 판단해서 요종도는 괜찮지 않을까 생각합니다.
  • 그럼에도 조금 더 개선할 방법은 찾아봐야할거 같네유

@rlagkswn00 rlagkswn00 self-assigned this Feb 12, 2026
@rlagkswn00 rlagkswn00 added the 🐛 Bug Something isn't working label Feb 12, 2026
@github-actions
Copy link

github-actions bot commented Feb 12, 2026

Unit Test Results

  74 files    74 suites   1m 27s ⏱️
538 tests 531 ✔️ 7 💤 0
541 runs  534 ✔️ 7 💤 0

Results for commit 0acc8f9.

♻️ This comment has been updated with latest results.

@rlagkswn00
Copy link
Member Author

@coderabbitai review

@rlagkswn00 rlagkswn00 requested review from jiyun921 and zbqmgldjfh and removed request for zbqmgldjfh February 12, 2026 13:58
Copy link
Collaborator

@jiyun921 jiyun921 left a comment

Choose a reason for hiding this comment

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

굿굿 수고하셨습니다!!

Comment on lines 27 to 35
@Override
public void saveAllCategoryNotices(List<Notice> notices) {
this.noticeJdbcRepository.saveAllCategoryNotices(notices);
}

@Override
public void saveAllDepartmentNotices(List<DepartmentNotice> departmentNotices) {
this.noticeJdbcRepository.saveAllDepartmentNotices(departmentNotices);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

혹시 이 리턴 없는 버전도 따로 남겨둔 이유가 있을까여??

Copy link
Member Author

@rlagkswn00 rlagkswn00 Feb 13, 2026

Choose a reason for hiding this comment

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

다른곳에서는 계속 배치 insert를 사용해서요!
전체업데이트할때! + 테스트할 때!

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Warning

Rate limit exceeded

@rlagkswn00 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/add-id-to-notice-message

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.

@rlagkswn00 rlagkswn00 merged commit adb0778 into develop Feb 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments