Skip to content

fix: /ranking/me 500 에러 수정 (@UserId 리졸버 primitive long 미인식) - #249

Merged
unam98 merged 1 commit into
mainfrom
fix/ranking-me-userid-resolver
Aug 17, 2026
Merged

fix: /ranking/me 500 에러 수정 (@UserId 리졸버 primitive long 미인식)#249
unam98 merged 1 commit into
mainfrom
fix/ranking-me-userid-resolver

Conversation

@unam98

@unam98 unam98 commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

작업 배경

  • dev 배포 후 실기기 테스트 중 GET /api/course/{courseId}/ranking/me가 500을 반환하는 걸 발견

원인

UserIdResolver#supportsParameterLong.class.equals(parameter.getParameterType())로 boxed java.lang.Long만 매칭하는데, Kotlin 컨트롤러의 @UserId userId: Long(non-null)은 바이트코드상 primitive long으로 컴파일되어 리졸버가 파라미터를 인식하지 못함. 그 결과 토큰 검증 로직(NullAccessTokenException 등)을 타지 않고 엉뚱하게 500으로 떨어짐.

변경 사항

  • @UserId userId: Long? (nullable)로 선언해 boxed Long으로 컴파일되게 수정
  • 서비스 호출부는 requireNotNull(userId) 사용 (!! 대신)

검증

  • 로컬 컴파일 확인
  • dev에 배포 후 실기기로 재검증 예정

🤖 Generated with Claude Code

UserIdResolver#supportsParameter가 boxed java.lang.Long만 매칭하는데,
Kotlin의 non-null Long은 바이트코드상 primitive long으로 컴파일되어
리졸버가 파라미터를 인식하지 못하고 있었음. nullable(Long?)로 선언해
boxed Long으로 컴파일되게 수정.
@unam98 unam98 self-assigned this Aug 17, 2026
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ad35ce0c-4da3-40e3-bbaa-806b029dec69


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.

@unam98
unam98 merged commit 1e7ded0 into main Aug 17, 2026
2 checks passed
@unam98
unam98 deleted the fix/ranking-me-userid-resolver branch August 17, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants