[Feat] 코스 절반 지점 도달 시 정상 인증 푸시 추가#110
Conversation
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesSummit Notification at 50% Course Distance
Sequence DiagramsequenceDiagram
participant Consumer as TrackingStreamConsumer
participant Service as TrackingMilestoneTriggerService
participant Redis as Redis Set
participant WebSocket as WebSocket Topic
participant FCM as FCM Notification
Consumer->>Service: evaluate(sessionId, userId, distanceTotal)
Service->>Service: detectCourseMode(milestones.size == 4)
alt Course Mode Detected
Service->>Service: computeCourseDistance(lastMilestone)
Service->>Service: evaluateSummit(distanceTotal, courseDistance)
Service->>Service: computeHalfwayMark(courseDistance)
Service->>Redis: SADD tracking:session:{id}:summit:notified
alt First Notification
Redis-->>Service: 1 (newly added)
Service->>WebSocket: publish(summit, halfwayMark, timestamp)
Service->>FCM: send(TRACKING_SUMMIT_REACHED)
FCM-->>Service: success or logged failure
else Already Notified
Redis-->>Service: 0 (exists)
Service->>Service: return early
end
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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/semosan/api/domain/tracking/service/TrackingMilestoneTriggerService.java`:
- Around line 146-148: The current code calls redisTemplate.expire(key, TTL)
unconditionally, causing unnecessary Redis writes after the summit marker is
already present; change the logic in TrackingMilestoneTriggerService so that you
only call redisTemplate.expire(key, TTL) when the SADD actually inserted the
member (i.e., when Long added returned from redisTemplate.opsForSet().add(key,
"1") is non-null and > 0). Concretely, move the expire call into the branch that
checks added (or guard it with if (added != null && added > 0L) {
redisTemplate.expire(key, TTL); }) and leave the existing handling for added ==
null || added == 0L unchanged.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1a966b61-0d9e-430e-aa8d-92dae6f7f6ce
📒 Files selected for processing (5)
src/main/java/com/semosan/api/domain/notification/enums/NotificationType.javasrc/main/java/com/semosan/api/domain/tracking/service/TrackingMilestoneTriggerService.javasrc/main/java/com/semosan/api/domain/tracking/service/TrackingSessionService.javasrc/main/java/com/semosan/api/domain/tracking/service/TrackingStreamConsumer.javasrc/main/resources/db/migration/V17__update_notifications_type_check.sql
50% 통과 후 매 GPS 점마다 EXPIRE 가 호출되던 핫패스 부하 제거. SADD 가 새로 추가된 경우(added=1) 에만 TTL 을 세팅하도록 가드 위치 이동.
🧾 요약
🔗 이슈
✨ 변경 내용
✅ 확인
Summary by CodeRabbit
New Features
Database