[fix] 모르는 서버 enum 값을 기본값으로 덮지 않고 실패시키기 - #157
Merged
Merged
Conversation
- MyPage 레벨은 SEED, 연습 상태는 PLANNED로 대체하던 폴백을 제거하고 도메인 예외를 던진다 - 두 값 모두 화면 분기를 결정하는 제어 값이라 조용히 틀리면 사용자가 잘못된 정보를 믿게 된다 - 폴백을 검증하던 테스트를 실패 검증으로 바꾸고 레벨 매핑 테스트를 추가 - 응답 DTO 기본값이 누락 필드를 가리는 별개 문제를 BACKLOG에 기록 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 42 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
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 |
PracticeException을 던지면 AuthErrorMapper가 "알 수 없는 오류"로 덮어써서 사용자에게 원인이 안 보인다. 같은 규칙을 member 경로에서는 AuthException으로 적용한다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
작업 요약
서버가 모르는 enum 값을 보낼 때 앱이 조용히 기본값으로 바꿔 보여주던 두 곳을 도메인 예외로 실패하게 바꿨습니다.
docs/conventions/mapper.md의 "필수·제어 값은 실패, 선택 값은 drop" 규칙에서 벗어나 있던 마지막 2건입니다.라이브 Swagger 대조 (2026-09-18)
https://api.stillstar.store/v3/api-docs기준으로 서버 enum과 도메인 enum이 정확히 일치합니다.MyPageResponse.level,OnboardingRequest.level,PracticeVisitResponse.newLevel:SEED, ROOKIE, OWNER, EXPLORER, NAVIGATOR=OnboardingLevelPracticeItem.status,PracticeRegisterResponse.status:PLANNED, VISITED, NOT_VISITED=PracticeStatusOnboardingRequest.soloParkingLevel은 서버가WIDE_ONLY/FAMILIAR_PLACE로 앱과 이름이 다른데,OnboardingMapper가 이미 명시적when으로 변환하고 있어 문제 없습니다즉 지금 깨지는 값은 없고, 서버가 값을 추가했을 때 조용히 틀리는 구조를 고치는 변경입니다.
주요 변경사항
MemberMapper: 모르는 레벨 →SEED대체를 없애고AuthException.Unknown으로 실패 (member 계층이 이미 쓰는 예외)PracticeMapper: 모르는 연습 상태 →PLANNED대체를 없애고PracticeException.Unexpected로 실패docs/BACKLOG.md: 이 항목 완료 처리, 새로 발견한 문제 1건 기록사용자에게 보이는 모습 (크래시 아님)
모르는 값이 오면 앱이 죽지 않고 해당 화면이 에러 안내로 바뀝니다. 경로별로 확인했습니다.
member API 경로에서
PracticeException을 던지면AuthErrorMapper가 "알 수 없는 오류가 발생했습니다."로 덮어써서, 마이페이지 경로만 member 계층 예외(AuthException)로 던지도록 맞췄습니다.리뷰 포인트
MyPageResponse가nickname: String = "",level: String = ""같은 기본값을 갖고 있어 서버가 필드를 빼먹어도 파싱이 성공합니다. 이번 스코프에서 빼고 BACKLOG에 적었습니다검증
assembleDebug, 전체test --rerun-tasks통과 (:core:data152개 실패 0)check-conventions.shBLOCK 통과, WARN 8건(변경 없음)🤖 Generated with Claude Code