Fix birthday bug being perpetually snoozed (#9488)

This commit is contained in:
Eric Bailey
2025-12-05 12:17:43 -06:00
committed by GitHub
parent 89223d92d1
commit db81cefb86
2 changed files with 23 additions and 4 deletions
+14 -4
View File
@@ -15,7 +15,10 @@ import debounce from 'lodash.debounce'
import {networkRetry} from '#/lib/async/retry'
import {PUBLIC_BSKY_SERVICE} from '#/lib/constants'
import {getAge} from '#/lib/strings/time'
import {snoozeBirthdateUpdateAllowedForDid} from '#/state/birthdate'
import {
hasSnoozedBirthdateUpdateForDid,
snoozeBirthdateUpdateAllowedForDid,
} from '#/state/birthdate'
import {useAgent, useSession} from '#/state/session'
import * as debug from '#/ageAssurance/debug'
import {logger} from '#/ageAssurance/logger'
@@ -331,10 +334,17 @@ export async function getOtherRequiredData({
}
/**
* If the user is under the minimum age, and the birthdate is not due to
* the legacy bug, snooze further birthdate updates for this user.
* If the user is under the minimum age, and the birthdate is not due to the
* legacy bug, AND we've not already snoozed their birthdate update, snooze
* further birthdate updates for this user.
*
* This is basically a migration step for this initial rollout.
*/
if (data.birthdate && !isLegacyBirthdateBug(data.birthdate)) {
if (
data.birthdate &&
!isLegacyBirthdateBug(data.birthdate) &&
!hasSnoozedBirthdateUpdateForDid(did!)
) {
snoozeBirthdateUpdateAllowedForDid(did!)
}