From 5fdd8df5ddb078fbc3300f91717b9eaa3490b96a Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 4 Aug 2026 19:36:44 +0300 Subject: [PATCH] fix temp garbage now lexicons are updated --- src/ageAssurance/debug.ts | 7 +------ src/ageAssurance/util.test.ts | 17 ++++++++--------- src/ageAssurance/util.ts | 23 ++++++++++++++--------- src/state/queries/notifications/types.ts | 11 +---------- 4 files changed, 24 insertions(+), 34 deletions(-) diff --git a/src/ageAssurance/debug.ts b/src/ageAssurance/debug.ts index c91311c06f..b640c4a2de 100644 --- a/src/ageAssurance/debug.ts +++ b/src/ageAssurance/debug.ts @@ -55,11 +55,6 @@ export const config: app.bsky.ageassurance.defs.Config = { }), ], }, - /* - * `platforms` is not in the generated `ConfigRegion` yet (the server sends - * it and `getAgeAssuranceRegionConfigForGeolocation` reads it), so this - * fixture asserts the shape until the lexicon carries the field. - */ { // On-device verification region, native-only (web users in TX are not // age assured). KWS is included as a fallback for when the device @@ -78,7 +73,7 @@ export const config: app.bsky.ageassurance.defs.Config = { access: 'none', }), ], - } as app.bsky.ageassurance.defs.ConfigRegion, + }, { countryCode: 'GB', minAccessAge: 13, diff --git a/src/ageAssurance/util.test.ts b/src/ageAssurance/util.test.ts index 561d808f85..59e46e785f 100644 --- a/src/ageAssurance/util.test.ts +++ b/src/ageAssurance/util.test.ts @@ -12,15 +12,14 @@ describe('getAgeAssuranceRegionConfigForGeolocation', () => { const region = ( countryCode: string, regionCode?: string, - platforms?: string[], - ) => - ({ - countryCode, - regionCode, - platforms, - minAccessAge: 13, - rules: [], - }) as app.bsky.ageassurance.defs.ConfigRegion + platforms?: app.bsky.ageassurance.defs.ConfigRegion['platforms'], + ): app.bsky.ageassurance.defs.ConfigRegion => ({ + countryCode, + regionCode, + platforms, + minAccessAge: 13, + rules: [], + }) it('skips regions for other platforms and continues matching', () => { const web = region('US', undefined, ['web']) diff --git a/src/ageAssurance/util.ts b/src/ageAssurance/util.ts index 6493a9aa5e..39bb14ab0c 100644 --- a/src/ageAssurance/util.ts +++ b/src/ageAssurance/util.ts @@ -46,18 +46,23 @@ export function getAgeAssuranceRegionConfigForGeolocation( geolocation: Geolocation, ): app.bsky.ageassurance.defs.ConfigRegion | undefined { /* - * The SDK's region matcher takes no `platform` filter (and the generated - * `ConfigRegion` carries no `platforms` field yet), so platform scoping is - * applied here: regions restricted to other platforms are dropped before - * matching, which is what passing `platform` to the old api helper did. - * Fold this back into the SDK call once it accepts a platform. + * The SDK's region matcher takes no `platform` filter, so platform scoping + * is applied here: regions restricted to other platforms are dropped before + * matching. Once the SDK accepts a platform, this whole function body + * collapses to: + * + * return getAgeAssuranceRegionConfig(config, { + * countryCode: geolocation.countryCode ?? '', + * regionCode: geolocation.regionCode, + * platform: AGE_ASSURANCE_PLATFORM, + * }) */ const scoped: app.bsky.ageassurance.defs.Config = { ...config, - regions: config.regions.filter(region => { - const platforms = (region as {platforms?: string[]}).platforms - return !platforms || platforms.includes(AGE_ASSURANCE_PLATFORM) - }), + regions: config.regions.filter( + region => + !region.platforms || region.platforms.includes(AGE_ASSURANCE_PLATFORM), + ), } return getAgeAssuranceRegionConfig(scoped, { countryCode: geolocation.countryCode ?? '', diff --git a/src/state/queries/notifications/types.ts b/src/state/queries/notifications/types.ts index aca1df943b..a08e8bdd35 100644 --- a/src/state/queries/notifications/types.ts +++ b/src/state/queries/notifications/types.ts @@ -1,15 +1,6 @@ import {type app} from '#/lexicons' -/** - * A `listNotifications` notification, widened with the `starterPack` the server - * attaches to a `follow` notification sourced from a starter pack. The pinned - * lexicon does not declare the field yet, so it is added here rather than read - * off an `unknown`. Drop this alias once the generated type carries it. - */ -export type Notification = - app.bsky.notification.listNotifications.Notification & { - starterPack?: app.bsky.graph.defs.StarterPackViewBasic - } +export type Notification = app.bsky.notification.listNotifications.Notification export type NotificationType = | StarterPackNotificationType