Repository navigation
[NM-410] 페더레이션 계정에서 is_test_account 가 항상 false 이던 문제 수정 - #156
Merged
ParkMazorika merged 1 commit intoAug 31, 2026
Merged
Conversation
심사·QA 계정 판별이 `Auth.auth().currentUser.email`(최상위 필드)만 읽고 있었다.
구글·애플처럼 페더레이션 전용으로 만들어진 계정은 이 필드가 비어 있고 이메일이
`providerData` 안에만 들어온다. Firebase 콘솔에는 이메일이 정상으로 보이기 때문에
눈으로는 잡히지 않는다.
그래서 `is_test_account` 는 어떤 계정에서도 `true` 가 되지 않았다 — 심사자·QA
트래픽을 분석에서 걸러내려던 NM-410 의 목적이 배포 이후 한 번도 달성되지 않은 상태였다.
시뮬레이터에 임시 로그를 넣어 확인한 실제 값:
topEmail=<nil> providerData=[google.com=nursematetest@gmail.com]
최상위 값을 먼저 보고 없으면 공급자 정보에서 찾도록 `signInEmail(_:)` 을 추가했다.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019qc4S5fQbGW3fnZMh7bPb8
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.
관련 이슈
변경 요약
심사·QA 계정 판별이
currentUser.email(최상위 필드)만 읽어서, 페더레이션 전용 계정(구글·애플)에서는 항상nil이 되어is_test_account가 어떤 계정에서도true가 되지 않았다.providerData를 함께 보도록 고쳤다.변경 내용
AnalyticsIdentity.signInEmail(_:)추가 —user.email ?? user.providerData.compactMap(\.email).first왜 눈에 안 띄었나 — Firebase 콘솔에는 이메일이 정상으로 표시된다. 최상위
email필드와providerData[].email이 별개라서, 페더레이션 전용 계정은 콘솔에 값이 보여도 클라이언트의 최상위 필드는 비어 있다. 앱 안에서currentUser.email을 읽는 곳이 여기 하나뿐이라 다른 경로로도 드러나지 않았다.영향 — NM-410 배포 이후 심사자·QA 트래픽이 분석에서 걸러지지 않고 그대로 섞여 있었다. 태그가 붙기 시작하는 건 이 수정이 들어간 빌드부터다.
테스트
시뮬레이터(iPhone 17 Pro / iOS 26.4)에 임시 로그를 넣어 실제 값을 확인:
수정 전후를 Firebase Analytics 로그(
-FIRAnalyticsDebugEnabled)로 대조:검증에 쓴 임시 로그는 제거했다(빌드 산출물 문자열 검사로 0건 확인).
남은 과제 (이 PR 범위 밖)
test_account_emails가 아직 반영되지 않는다. 인증 리스너는 세션 복원으로 즉시 발화하는데fetchAndActivate()는SceneDelegate에서 한참 뒤에 돌아, 판별 시점의 값이 항상 빈 문자열이다. 게다가 Remote Config 가 나중에 도착해도 재계산하지 않는다(.remoteConfigDidUpdate구독자는AppGate뿐). "배포 없이 QA 계정을 바꾼다"는 의도가 아직 동작하지 않는다.providerData에도 이메일이 없을 수 있다. 근본적으로는 서버가 회원 정보나 테스트계정 플래그를 내려주는 쪽으로 옮기는 게 맞다.체크리스트
[NM-XXX] 요약형식<type>/NM-XXX-요약형식[NM-XXX] type: 요약형식