chore(auth): delete dead hasProfile() — it was C-AUTH-001 waiting to be called

Final sweep after the auth hardening: audited every remaining getUser caller for
the exists-but-empty trap. All are display-only (partner names/photos — a stale
read shows a blank label for a frame, writes nothing, routes nothing). One
finding: hasProfile() has zero callers and contains both halves of C-AUTH-001
verbatim — runCatching{...}.getOrDefault(false) turns a failed read into "has no
profile", and the cache-default get() means the post-sign-in stub document reads
as "no profile" too. Its name invites exactly the onboarding-routing use that
just burned us, so the next person reaching for it would reintroduce the bug
through the front door. Deleted from all three layers; git history keeps it if a
safe variant is ever wanted (it would need Source.SERVER + stub-awareness + a
Result return, at which point it's resolveDestination).

Compile clean, full unit suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
null 2026-07-15 01:53:04 -05:00
parent 18e6cf7b30
commit b2a04b7187
3 changed files with 0 additions and 8 deletions

View File

@ -210,11 +210,6 @@ class FirestoreUserDataSource @Inject constructor(
val ENCRYPTED_PROFILE_FIELDS = listOf("displayName", "sex")
}
suspend fun hasProfile(uid: String): Boolean = runCatching {
val snap = userRef(uid).get().await()
snap.exists() && !snap.getString("displayName").isNullOrBlank()
}.getOrDefault(false)
suspend fun storeFcmToken(uid: String, token: String) {
userRef(uid).set(
mapOf("fcmToken" to token, "lastActiveAt" to System.currentTimeMillis()),

View File

@ -33,8 +33,6 @@ class UserRepositoryImpl @Inject constructor(
override suspend fun updateBirthDate(uid: String, birthDateMillis: Long) =
dataSource.updateBirthDate(uid, birthDateMillis)
override suspend fun hasProfile(uid: String): Boolean = dataSource.hasProfile(uid)
override suspend fun storeFcmToken(uid: String, token: String) =
dataSource.storeFcmToken(uid, token)

View File

@ -15,7 +15,6 @@ interface UserRepository {
suspend fun updatePhotoUrl(uid: String, photoUrl: String)
suspend fun updateSex(uid: String, sex: String)
suspend fun updateBirthDate(uid: String, birthDateMillis: Long)
suspend fun hasProfile(uid: String): Boolean
suspend fun storeFcmToken(uid: String, token: String)
suspend fun storeTokenMetadata(uid: String, token: String, metadata: TokenRegistrar.DeviceMetadata)
suspend fun updateNotificationPrefs(