Repository navigation
refactor(receiver): 수신자 서버 거절 예외 4종을 ReceiverFailure.ServerRejection 하나로 압축 (#934 4-A) [base: develop] - #1054
Merged
Merged
Conversation
…하나로 압축 sealed 루트 ReceiverServerRejectionException 과 하위 3종(MasterKey·EmailAuth· DeliveryVerification)을 ReceiverFailure.ServerRejection 하나로 줄인다. 하위 타입을 나눈 명분은 KDoc 상 "사유 code 별 분기를 넣을 때 when 이 누락을 잡아준다" 였으나, 셋을 갈라 보는 프로덕션 코드가 없었다 — 소비처는 상위 타입만 보고 data 계층은 셋을 만들기만 했다. 어느 endpoint 가 거절했는지는 stack trace 에 남는다. 소비처는 루트로 좁혀 when 을 exhaustive 하게 만들었다. toErrorPayload 와 shouldReportInReceiverFlow 가 단일 타입 캐스팅이라 sealed 이득이 0 이었던 것을, 수신자 실패 유형이 늘면 두 곳이 컴파일 에러로 잡히게 했다. 판정 기준(4xx 대역·code allowlist·문구 유무)은 그대로라 동작은 변하지 않는다. 토스트·스낵바 문구를 좌우하는 노출 게이트를 건드리므로 ErrorPayloadTest 6케이스와 ReceiverFlowReportingTest 4케이스를 그대로 이행해 회귀 가드를 유지했다. 함께 수신자 열람 인증 화면의 주석을 정리했다. USER_DISPLAYABLE_SERVER_CODES 의 code 별 의미 나열은 BE 소유라 걷었다 — 한 번 틀려 #654 로 정정한 자리다. ErrorPayload KDoc 의 통일 소관 표기(#446)는 오참조라 제거했고(실제 소관은 #604), 판정 근거 주석은 실제로 판정하는 함수 자리로 옮겼다. AfternoteFailureReporting 의 판정표는 코드와 중복이라 걷고 근거만 압축했다.
Sadturtleman
approved these changes
Aug 24, 2026
Contributor
|
이 PR 은
|
…eiver # Conflicts: # feature/afternote/presentation/src/main/kotlin/com/afternote/feature/afternote/presentation/reporting/AfternoteFailureReporting.kt
1hyok
added a commit
that referenced
this pull request
Aug 25, 2026
AppAndReceiverCompletionAndroidTest 의 import 블록에서 충돌했다. #1054 가 ReceiverEmailAuthException 을 ReceiverFailure 로 접었고(#934), 이 브랜치는 같은 자리에서 MindRecordReceiverRepository import 를 픽스처로 바꿨다. 양쪽을 합쳐 FakeMindRecordReceiverRepository + ReceiverFailure 를 남긴다. 본문의 사용처는 자동 병합으로 develop 쪽 변경이 그대로 들어왔다. 검증: :koverXmlReportCi :konsist:test :build-logic:test :app:compileDebugAndroidTestKotlin 전 모듈 ktlintCheck 통과.
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.
#934 의 4-A 단계만 담는다. 1·2단계는 #1051, 4-B(애프터노트)는 별도 PR — 이슈는 닫지 않는다.
무엇을
ReceiverServerRejectionException(sealed 루트) + 하위 3종(MasterKey·EmailAuth·DeliveryVerification) →ReceiverFailure.ServerRejection하나. 파일 4개 → 1개.왜 하위 타입을 지우나
나눠 둔 명분은 KDoc 상 "사유 code 별 분기를 넣을 때
when이 누락을 잡아준다" 였는데, 셋을 갈라 보는 프로덕션 코드가 없었다. 소비처는 상위 타입만 보고, data 계층은 셋을 만들기만 했다. 어느 endpoint 가 거절했는지는 stack trace 에 남으므로 타입으로 나눌 이유가 없다. 구분이 실제로 필요해지면 그때 필드를 더한다.묶기만 하지 않았다
toErrorPayload와shouldReportInReceiverFlow는 단일 타입 캐스팅(as?/is)이라sealed이득이 0 이었다. 루트로 좁혀when을 exhaustive 하게 만들어, 수신자 실패 유형이 늘면 두 소비처가 컴파일 에러로 잡힌다.판정 기준은 그대로다 — 4xx 대역·code allowlist·문구 유무 모두 손대지 않았으므로 화면 문구와 텔레메트리 기록 대상이 변하지 않는다.
회귀 가드
노출 게이트는 사용자가 보는 스낵바 문구를 직접 좌우한다(#651 이 고친 회귀).
ErrorPayloadTest6케이스·ReceiverFlowReportingTest4케이스를 케이스 그대로 이행했다 — 5xx 문구 제외, 미등재 code 폴백, 문구 없는 4xx 폴백 등 조합이 전부 살아 있다.주석 정리 동반
USER_DISPLAYABLE_SERVER_CODES의 code 별 의미 나열ErrorPayloadKDoc 의통일은 #446 소관status 만 보고 code 를 안 보면…판정 근거shouldReportInReceiverFlowKDoc 판정표AfternoteFailureStage하단 이전 이력(#615)남긴 것: Crashlytics 8건 보관 한도(+공식 문서 링크), 마스터 키를 대신 획득하지 않는 이유(#454), 업로드 진행 중 잠금(#711),
@Valid실패가 리터럴 code=400 으로 온다는 실측(#600).검증
:app:compileDebugUnitTestKotlin:app:compileDebugAndroidTestKotlin(#949 신설)ktlintCheck:feature:receiver:data·:feature:receiver:presentation·:feature:afternote:presentationtestDebugUnitTest시각 검증 해당 없음 — 리소스·Compose 변경 0(바뀐 presentation 파일은 상태 data class 와 ViewModel). baseline 사이클 미실행.
리뷰어에게
AfternoteFailureReporting.kt를 refactor(core): 인증·계정 예외 6종을 CoreAuthFailure sealed 루트로 압축 (#934 1·2단계) [base: develop] #1051 도 건드린다. 그쪽은 백틱 주석 안 심볼명 치환이고 여기선 그 문단을 지운다. 순차 머지 시 뒤쪽이 리베이스 한 번 필요하고 해결은 "삭제 채택".ServerRejection이 여전히status·serverCode를 들고 있는 건 의도적으로 남긴 것이다. 도메인이 HTTP 를 아는 계층 위반이 맞지만, 화면이 그 값으로 판정하고 있어 필드만 지우면 판정 근거를 잃는다. 판정을 data 로 내리는 작업은 동작 변경을 동반하므로 수신자 도메인 예외가 HTTP status·서버 code 를 나른다 — 노출·기록 판정을 data 로 내리고 도메인 어휘로 번역 #1053 으로 분리했다(blocked by refactor(core): 수신자 입력 거절의 서버 원문을 고정 진단 문구로 바꾼다 #934).AppAndReceiverCompletionAndroidTest·ReceiverVerificationAndroidTest)도 갱신했다 — androidTest 도메인 API 드리프트 44건+런타임 7건 수정, PR 컴파일 게이트 추가 #949 가:app:compileDebugAndroidTestKotlin을 필수 게이트에 넣어 빠뜨리면 깨진다.