fix: AuthInterceptor 토큰 재발급 실패 시 응답 leak으로 인한 크래시 수정 - #410
Conversation
handleGetNewTokenFailure가 실패한 refreshTokenResponse를 close() 하지 않고 반환해서, OkHttp 커넥션 풀이 오염되고 이후 재시도 응답을 읽던 HttpLoggingInterceptor가 IllegalStateException: closed로 크래시했음. access/refresh 토큰이 둘 다 무효할 때 재현됨 (예: 딥링크로 진입 시 토큰 유효성 검증 없이 바로 API를 호출하는 경로에서 자주 노출).
|
Warning Review limit reached
Next review available in: 23 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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. Comment |
PR diff로 변경된 패키지만 --tests 필터로 골라 돌리는 CI 스크립트가, 그 패키지에 테스트 클래스가 하나도 없으면 "No tests found for given includes"로 빌드 자체를 실패시켰음. failOnNoMatchingTests=false로 이 경우 그냥 스킵하도록 수정.
작업 배경
FATAL EXCEPTION: OkHttp Dispatcher,IllegalStateException: closed)SchemeActivity.isUserLoggedIn()이 토큰의 유효성 검증 없이 "존재 여부"만 확인해서, access/refresh 토큰이 둘 다 무효한 상태에서도 API를 그대로 호출하는 경로였음원인
AuthInterceptor.handleGetNewTokenFailure가 토큰 재발급 요청의 실패 응답(refreshTokenResponse)을close()하지 않고 반환함. 안 닫힌 Response가 OkHttp 커넥션 풀을 오염시켜서, 바로 이어지는 재시도 요청의 응답을 읽던HttpLoggingInterceptor가IllegalStateException: closed로 죽음.바로 위
handleGetRefreshTokenSuccess는refreshTokenResponse.use { ... }로 제대로 닫는데, 실패 케이스만 빠뜨린 비대칭 버그였음.변경 사항
refreshTokenResponse.close()한 줄 추가영향 범위
SchemeActivity가 토큰 유효성 검증 없이 바로 API 호출Test Plan
./gradlew testDebugUnitTest전체 통과🤖 Generated with Claude Code