Skip to content

Conversation

@hyerinhwang-sailin
Copy link
Collaborator

@hyerinhwang-sailin hyerinhwang-sailin commented Oct 20, 2025

Related issue 🛠

Work Description ✏️

개요

  • 기존 잘못 적용된 딥링크를 수정했습니다.
  • n000회 박수 시 푸시알림 전송 대상을 기획 요구사항에 맞게 전체 유저가 아닌 솝탬프 발행 유저로 수정했습니다.
  • 스탬프 상세 화면으로 이동하는 딥링크 빌더를 도입후 클랩 알림 팩토리 3종에 적용했습니다.(닉네임 URL 인코딩 포함)
  • 알림 발송 경로는 RestTemplate DI(빈 주입)로 전환하고, 예외/재시도 로깅을 보강했습니다.
  • 마일스톤 마킹과 발송을 동일 트랜잭션에서 처리되도록 ClapMilestoneGuard 트랜잭션 정책을 조정했습니다.

변경 사항 (Commits)

  1. feat(SoptampDeepLinkBuilder): 스탬프 상세 딥링크 빌더 추가(닉네임 UTF-8 인코딩)
    • 포맷: home/soptamp/entire-part-ranking/part-ranking/missions/missionDetail?id={id}&isMine={bool}&nickname={encoded}&part={part}
  2. fix(ClapRequest): 오너 전용 박수 알림 팩토리 3종 정리 및 딥링크 적용
    • ofOwnerClapFirst(...) : 첫 박수
    • ofOwnerClap100Or500(...) : 100/500번째
    • ofOwnerClapKilo(...) : 1000 단위(1000/2000/…)
    • 모든 케이스 오너 1인 대상, isMine=true로 이동
  3. fix(ClapEventListener): RestTemplate 빈 주입 전환 및 발송 실패 로깅 보강
    • 기존 new RestTemplate() 제거 → 공통 빈 사용
    • 실패 시 WARN 로그로 페이로드/원인 기록
    • ClapRequest 변경사항 반영(새 팩토리 호출)
  4. fix(RestTemplateConfig): 예외 처리 개선
    • 원본 RuntimeException 보존
    • 비런타임 예외는 RestClientException으로 의미 있는 래핑
  5. fix(ClapMilestoneGuard): 트랜잭션 정책 정리
    • tryMarkFirstHit기본 @transactional(REQUIRED) 로 변경
    • 리스너의 @Transactional(REQUIRES_NEW)참여하여 마킹+발송 동시 커밋/롤백
    • 발송 실패 시 롤백되어 다음 기회 재시도 가능

설계 의도 / 이유

  • 일관된 딥링크 생성: 화면 이동 파라미터(id/isMine/nickname/part) 보장 + 닉네임 인코딩 이슈 방지
  • 중복 발송 방지: clap_milestone_hit의 UNIQUE(stamp_id, milestone) + INSERT ... ON CONFLICT DO NOTHING
  • 안정적 발송: 공통 RestTemplate 빈 + 개선된 예외 처리/로깅으로 운영 가시성 향상
  • 원자성 보장: 마킹과 발송을 같은 트랜잭션으로 처리해 반쯤 성공 상태 방지(실패 시 깔끔히 롤백)

Trouble Shooting ⚽️

Related ScreenShot 📷

Uncompleted Tasks 😅

To Reviewers 📢

@hyerinhwang-sailin hyerinhwang-sailin linked an issue Oct 20, 2025 that may be closed by this pull request
1 task
@hyerinhwang-sailin hyerinhwang-sailin self-assigned this Oct 20, 2025
@hyerinhwang-sailin hyerinhwang-sailin added the 🛠️ BugFix 버그 해결 label Oct 20, 2025
@hyerinhwang-sailin hyerinhwang-sailin merged commit aa6ab7d into dev Oct 20, 2025
1 check passed
Copy link
Member

@jher235 jher235 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 +6 to +17
public final class SoptampDeepLinkBuilder {
private static final String BASE =
"home/soptamp/entire-part-ranking/part-ranking/missions/missionDetail";

private SoptampDeepLinkBuilder() {}

public static String buildStampDetailLink(long stampId, boolean isMine, String nickname, String part) {
String encodedNickname = URLEncoder.encode(nickname, StandardCharsets.UTF_8);
return String.format("%s?id=%d&isMine=%s&nickname=%s&part=%s",
BASE, stampId, Boolean.toString(isMine), encodedNickname, part);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

저희 미션 조회할 때 missionId와 nickname으로 API를 조회할텐데 딥링크에 missionId 는 없어도 괜찮을까요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이거 클라 쪽에 재확인해봐야할 것 같아요!

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.

[FIX] 푸시알림 관련 수정

2 participants