Skip to content

[fix] 지원서 이전 모집상태와 비교하지않고 알림을 보내는 문제를 수정한다#832

Merged
lepitaaar merged 2 commits intodevelop/befrom
fix/add-recruitment-status-check-diff
Nov 10, 2025
Merged

[fix] 지원서 이전 모집상태와 비교하지않고 알림을 보내는 문제를 수정한다#832
lepitaaar merged 2 commits intodevelop/befrom
fix/add-recruitment-status-check-diff

Conversation

@lepitaaar
Copy link
Contributor

@lepitaaar lepitaaar commented Nov 10, 2025

#️⃣연관된 이슈

#831

📝작업 내용

문제상황

image

무수한 알림이 와............

알림을 보내는 기준은 기존 모집 상태와 바뀐 모집상태가 달라지게 되면 알림을 보내야합니다.
하지만 기존 코드에는 이전과 바뀔 상태를 비교하는 로직이 빠져있었고 그에 따라 스케쥴러 시간마다 알림이 보내졌습니다..........
diffing 함수 만들어서 고쳤습니다!

중점적으로 리뷰받고 싶은 부분(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

논의하고 싶은 부분(선택)

논의하고 싶은 부분이 있다면 작성해주세요.

🫡 참고사항

Summary by CodeRabbit

  • 버그 수정

    • 모집 상태가 실제로 변경되지 않은 경우 불필요한 알림이 중복 발송되는 문제를 해결했습니다. 상태 변동이 없으면 알림 발송을 건너뜁니다.
  • 최적화

    • 백엔드 로직을 정리하고 불필요한 처리 및 중복 작업을 제거해 시스템 안정성과 효율성을 개선했습니다.

@lepitaaar lepitaaar self-assigned this Nov 10, 2025
@lepitaaar lepitaaar added 🐞 Bug Something isn't working 💾 BE Backend 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정 labels Nov 10, 2025
@vercel
Copy link

vercel bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
moadong Ready Ready Preview Comment Nov 10, 2025 8:14am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Invalid regex pattern for base branch. Received: "**" at "reviews.auto_review.base_branches[0]"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

모집 상태 계산에서 이전 상태를 캡처해 신규 상태와 비교하고, 변경이 없으면 알림 전송을 건너뛰도록 조기 반환하는 로직을 추가합니다. RecruitmentStateChecker에서 사용하지 않는 Firebase 관련 임포트들을 제거했습니다.

Changes

코호트 / 파일(s) 변경 요약
임포트 정리
backend/src/main/java/moadong/club/service/RecruitmentStateChecker.java
Firebase Cloud Messaging 및 기타 미사용 임포트 제거; java.time.ZonedDateTime, java.util.List 등 필요한 임포트 정리
상태 비교 및 조기 반환 추가
backend/src/main/java/moadong/club/util/RecruitmentStateCalculator.java
calculate 메서드에서 클럽의 이전 recruitment 상태(oldStatus)를 캡처하고 신규 상태(newStatus)를 계산한 뒤 두 상태가 동일하면 조기 반환. 상태가 변경된 경우에만 메시지 구성 및 푸시 전송 진행; 클럽의 recruitment 상태 갱신 포함

Sequence Diagram(s)

sequenceDiagram
    participant Scheduler
    participant RecruitmentStateCalculator
    participant MessageService
    Scheduler->>RecruitmentStateCalculator: calculate(club)
    rect rgb(220,240,255)
    Note over RecruitmentStateCalculator: oldStatus 캡처\nnewStatus 계산
    RecruitmentStateCalculator->>RecruitmentStateCalculator: oldStatus == newStatus ?
    alt 동일
        RecruitmentStateCalculator-->>Scheduler: 조기 반환 (알림 미전송)
    else 변경
        RecruitmentStateCalculator->>RecruitmentStateCalculator: 클럽 상태 업데이트
        RecruitmentStateCalculator->>MessageService: 메시지 구성 및 전송
        MessageService-->>RecruitmentStateCalculator: 전송 결과
    end
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • 검토 필요 지점:
    • calculate에서 oldStatus 캡처 시점과 동시성(여러 스레드/스케줄러 간) 관련 가능성 확인
    • 상태 비교 조건(동일 판정 기준)과 상태 업데이트 동작 일관성 검증

Possibly related issues

Possibly related PRs

Suggested reviewers

  • Zepelown
  • PororoAndFriends
  • alsdddk
  • yw6938

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경사항의 핵심을 명확히 설명합니다: 이전 모집상태와의 비교 로직 누락으로 인한 반복 알림 발송 문제를 수정하는 내용입니다.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/add-recruitment-status-check-diff

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a27642f and 90a5e33.

📒 Files selected for processing (1)
  • backend/src/main/java/moadong/club/util/RecruitmentStateCalculator.java (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-05-19T05:45:52.957Z
Learnt from: lepitaaar
Repo: Moadong/moadong PR: 406
File: backend/src/main/java/moadong/club/service/ClubApplyService.java:34-38
Timestamp: 2025-05-19T05:45:52.957Z
Learning: The code duplication between createClubApplication and editClubApplication methods in ClubApplyService.java is acknowledged but will be addressed in a future refactoring, as per the developer's plan.

Applied to files:

  • backend/src/main/java/moadong/club/util/RecruitmentStateCalculator.java

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.

@github-actions
Copy link

github-actions bot commented Nov 10, 2025

Test Results

78 tests   75 ✅  15s ⏱️
13 suites   3 💤
13 files     0 ❌

Results for commit 90a5e33.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
backend/src/main/java/moadong/club/util/RecruitmentStateCalculator.java (1)

30-32: 메서드 가시성을 재검토하세요.

diffRecruitmentStatus 메서드가 public으로 선언되어 있지만, 현재 이 클래스 내부에서만 사용되는 것으로 보입니다. 외부에서 호출할 필요가 없다면 private으로 변경하는 것이 캡슐화 측면에서 더 좋습니다.

-public static boolean diffRecruitmentStatus(ClubRecruitmentStatus oldStatus, ClubRecruitmentStatus newStatus) {
+private static boolean diffRecruitmentStatus(ClubRecruitmentStatus oldStatus, ClubRecruitmentStatus newStatus) {
     return oldStatus == newStatus;
 }

단, 앞선 리뷰 코멘트에서 제안한 대로 이 메서드를 아예 제거하고 직접 비교하는 것을 더 권장합니다.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a4a07bf and a27642f.

📒 Files selected for processing (2)
  • backend/src/main/java/moadong/club/service/RecruitmentStateChecker.java (1 hunks)
  • backend/src/main/java/moadong/club/util/RecruitmentStateCalculator.java (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test
🔇 Additional comments (1)
backend/src/main/java/moadong/club/service/RecruitmentStateChecker.java (1)

14-15: LGTM! 임포트 정리가 적절합니다.

사용하지 않는 Firebase 관련 임포트를 제거하고 실제로 사용되는 ZonedDateTimeList 임포트를 추가한 것은 코드 위생에 좋습니다.

Copy link
Member

@Zepelown Zepelown left a comment

Choose a reason for hiding this comment

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

고생하셨습니다.
휴대폰 테러당했겠군여

@lepitaaar lepitaaar merged commit ae6ac89 into develop/be Nov 10, 2025
5 checks passed
@lepitaaar lepitaaar deleted the fix/add-recruitment-status-check-diff branch November 20, 2025 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💾 BE Backend 🐞 Bug Something isn't working 🛠Fix 기능이 의도한 대로 동작하지 않는 버그를 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants