-
Notifications
You must be signed in to change notification settings - Fork 0
[PC-000] 인증번호 검증 시 oauthProvider 비회원일 경우 null 반환 #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
📝 WalkthroughWalkthroughThe pull request modifies OAuth provider handling by changing the return type of Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI Agents
In
@core/network/src/main/java/com/puzzle/network/model/auth/VerifyAuthCodeResponse.kt:
- Line 14: The helper function toDomain() in VerifyAuthCodeResponse only
converts the oauthProvider field and should be renamed to clarify its limited
purpose; rename to toOAuthProviderDomain() (or getOAuthProvider()) in
VerifyAuthCodeResponse.kt and update all call sites (notably
AuthRepositoryImpl.verifyAuthCode()) to use the new name, ensuring nullable
return handling is preserved and updating any tests or usages accordingly so the
method name accurately reflects it only maps the oauthProvider enum rather than
the full response.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
core/domain/src/main/java/com/puzzle/domain/model/auth/OAuthProvider.ktcore/network/src/main/java/com/puzzle/network/model/auth/VerifyAuthCodeResponse.kt
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
🔇 Additional comments (2)
core/domain/src/main/java/com/puzzle/domain/model/auth/OAuthProvider.kt (2)
7-7: This suggestion should be reconsidered. TheUNKNOWNenum value is actively used in the codebase to check OAuth provider state (seeAlreadyRegisteredPhoneDialog.kt:25). Althoughcreate()may returnnullfor unrecognized providers, the enum value itself remains necessary for runtime comparisons and conditional logic throughout the application.Likely an incorrect or invalid review comment.
12-16: Confirm the breaking API change has been properly handled.The return type changed from
OAuthProvidertoOAuthProvider?. The single call site inVerifyAuthCodeResponse.ktproperly handles the nullable return by declaring its own return type asOAuthProvider?, correctly propagating the null case.
| val oauthProvider: String?, | ||
| ) { | ||
| fun toDomain(): OAuthProvider = OAuthProvider.create(oauthProvider) | ||
| fun toDomain(): OAuthProvider? = OAuthProvider.create(oauthProvider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find all usages of toDomain() in the codebase
rg -n '\.toDomain\(\)' --type kotlin -C 3
# Also search for VerifyAuthCodeResponse usages
rg -n 'VerifyAuthCodeResponse' --type kotlin -C 2Repository: Piece-Puzzly/Piece-Android
Length of output: 29658
🏁 Script executed:
cat -n core/network/src/main/java/com/puzzle/network/model/auth/VerifyAuthCodeResponse.ktRepository: Piece-Puzzly/Piece-Android
Length of output: 593
🏁 Script executed:
sed -n '100,140p' core/data/src/main/java/com/puzzle/data/repository/AuthRepositoryImpl.ktRepository: Piece-Puzzly/Piece-Android
Length of output: 1004
🏁 Script executed:
rg -n 'object OAuthProvider|class OAuthProvider|fun create' --type kotlin -A 15 | grep -A 15 'OAuthProvider'Repository: Piece-Puzzly/Piece-Android
Length of output: 5896
Rename method to clarify it only converts the OAuth provider field.
The method name toDomain() is misleading—it only converts the oauthProvider field to an OAuthProvider enum, while the response also contains role, accessToken, refreshToken, and isPhoneNumberDuplicated. These other fields are handled separately in the caller (AuthRepositoryImpl.verifyAuthCode()), making the partial conversion unclear.
Consider renaming to toOAuthProviderDomain() or getOAuthProvider() to accurately reflect what the method does. Alternatively, if all fields should be converted together, create a complete domain response model.
Regarding null handling: the nullable return type is already properly managed at the call site, where AuthRepositoryImpl.verifyAuthCode() is typed to return OAuthProvider? and directly returns the result.
🤖 Prompt for AI Agents
In
@core/network/src/main/java/com/puzzle/network/model/auth/VerifyAuthCodeResponse.kt
at line 14, The helper function toDomain() in VerifyAuthCodeResponse only
converts the oauthProvider field and should be renamed to clarify its limited
purpose; rename to toOAuthProviderDomain() (or getOAuthProvider()) in
VerifyAuthCodeResponse.kt and update all call sites (notably
AuthRepositoryImpl.verifyAuthCode()) to use the new name, ensuring nullable
return handling is preserved and updating any tests or usages accordingly so the
method name accurately reflects it only maps the oauthProvider enum rather than
the full response.
kkh725
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다
1. ⭐️ 변경된 내용
2. 🖼️ 스크린샷(선택)
3. 💡 알게된 부분
4. 📌 이 부분은 꼭 봐주세요!
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.