Open
Conversation
devxb
reviewed
May 5, 2026
|
|
||
| val gotchaResponses = gotchaFacadeV3.gotcha(token, gotchaType, count) | ||
|
|
||
| val userId = MDC.get(USER_ID) |
Member
There was a problem hiding this comment.
InternalAuth.findUserId() 사용하면 좋을거 같습니다~
userId null이면 예외 대신 silent하게 동작하도록 되면 좋을거 같아요.
Member
Author
There was a problem hiding this comment.
좋은 의견 감사합니다 🙏
말씀해주신 대로 MDC.get 직접 조회 대신 InternalAuth.findUserId() 를 사용하도록 변경했고, userId 가 null 이면 트래킹을 건너뛰고 silent 하게 동작하도록 수정했습니다. 테스트도 null 케이스 추가했습니다. (커밋: 6987769)
Comment on lines
+88
to
+96
| eventLogger.track( | ||
| eventName = "complete_login", | ||
| distinctId = user.id.toString(), | ||
| properties = mapOf( | ||
| "provider" to "github", | ||
| "user_id" to user.id, | ||
| "is_new_user" to isNewUser, | ||
| ), | ||
| ) |
Member
There was a problem hiding this comment.
runCatching이 반복되는데, eventLogger.track 내부에 runcatching을 넣고 외부에서는 빼면 좋을거 같네용
Member
Author
There was a problem hiding this comment.
좋은 지적 감사합니다 🙏
MixpanelEventLogger.track 내부에 이미 runCatching 이 있는데 호출부에서 중복으로 감싸고 있던 부분을 제거했습니다. EventLogger 인터페이스 KDoc 에도 "절대 throw 하지 않는다" 는 계약을 명시해서 향후 새 구현체/호출부에서도 동일 규칙이 적용되도록 했습니다. 호출부 6곳 모두 정리되었습니다. (커밋: 6987769)
…rnalAuth 도입 - EventLogger.track 계약을 "절대 throw 하지 않음"으로 명시 (KDoc) - 호출부 6곳의 외부 runCatching/onFailure 제거 (MixpanelEventLogger 내부에서 이미 보장) - GotchaController가 MDC 직접 조회 대신 InternalAuth.findUserId() 사용, userId null이면 silent skip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
Notion 이벤트 명세 Tagging Round 1차 중 서버에서 트리거 가능한 이벤트를 Mixpanel로 전송합니다.
화면 단 트래킹은 별도로 작업 완료. 이 PR은 서버 사이드 이벤트만 다룹니다.
부착된 이벤트 (5개)
complete_loginidentity/app/GithubLoginFacade.ktcomplete_loginidentity/app/AppleLoginFacade.ktcomplete_gotchagotcha/controller/GotchaController.ktcomplete_make_quizquiz/infra/hibernate/NewQuizCreatedInsertHibernateEventListener.ktcomplete_solve_quizquiz/infra/hibernate/QuizSolveContextDoneHibernateEventListener.ktsubmit_quiz_answerquiz/app/SolveQuizFacade.kt운영 환경변수 추가 필요
MIXPANEL_PROJECT_TOKENc09aa30641cc7e222df87f00cdc45fa9deploy/) 또는 GitHub Actions secret 으로 주입.test프로파일에서는 자동으로NoOpEventLogger로 fallback.변경 구조
core/event/EventLogger인터페이스 + Mixpanel/NoOp 구현 + Spring@Configurationgradle/analytics.gradle(com.mixpanel:mixpanel-java:1.5.4)application.properties에mixpanel.project.token=\${MIXPANEL_PROJECT_TOKEN:}작업 외 (다른 repo)
complete_merge→ render 서비스 (gitanimalsrepo)complete_create_guild,complete_join_guild→ guild 서비스 (별도 repo)빌드 검증 노트
본 PR 의 변경은 정적 분석으로 검증됨 (import 해소, 시그니처 일치, SDK API 호환, 의존성 classpath). 로컬 환경에 JDK 가 없어
./gradlew compileKotlin test는 미실행. CI 빌드에서 1차 검증을 받아주세요.