diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index 6267907f16..cc97daab69 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -1683,7 +1683,7 @@ "count": 8 }, "typescript/no-unsafe-member-access": { - "count": 9 + "count": 8 } }, "src/view/com/util/EmptyState.tsx": { diff --git a/src/components/moderation/ReportDialog/utils/reportSubject.ts b/src/components/moderation/ReportDialog/utils/reportSubject.ts index a639323b9b..a4bef9f43a 100644 --- a/src/components/moderation/ReportDialog/utils/reportSubject.ts +++ b/src/components/moderation/ReportDialog/utils/reportSubject.ts @@ -2,9 +2,10 @@ import {type com} from '#/lexicons' /** * The `subject` union of the generated `createReport` input body. The lexicon - * declares only `com.atproto.admin.defs#repoRef` and `com.atproto.repo.strongRef` - * with branded string fields (`did: l.DidString`, `uri: l.AtUriString`, - * `cid: l.CidString`). + * declares only `com.atproto.admin.defs#repoRef` and `com.atproto.repo.strongRef`. + * `did`/`uri` are branded string types (`l.DidString`, `l.AtUriString`); `cid` + * is typed `l.CidString`, which is a plain (unbranded) `string` alias, so only + * the former two need assertions below. */ type ReportSubject = com.atproto.moderation.createReport.$InputBody['subject'] @@ -14,7 +15,7 @@ type RepoRefSubject = Extract< {$type: 'com.atproto.admin.defs#repoRef'} > -/** The strongRef arm of the subject union, carrying the branded `uri`/`cid`. */ +/** The strongRef arm of the subject union, carrying the branded `uri`. */ type StrongRefSubject = Extract< ReportSubject, {$type: 'com.atproto.repo.strongRef'} @@ -33,8 +34,8 @@ export function accountReportSubject(did: string): ReportSubject { /** * Branded strongRef subject from plain uri/cid strings. The app holds these as - * plain strings; brand `uri` to the lexicon's `uri` slot (`cid` is a plain - * string in the generated type, so it needs no assertion). + * plain strings; brand `uri` to the lexicon's `uri` slot (`l.CidString` is an + * unbranded `string` alias, so `cid` needs no assertion). */ export function recordReportSubject(uri: string, cid: string): ReportSubject { return { diff --git a/src/view/com/posts/PostFeedErrorMessage.tsx b/src/view/com/posts/PostFeedErrorMessage.tsx index d51c9a0161..bf545633f7 100644 --- a/src/view/com/posts/PostFeedErrorMessage.tsx +++ b/src/view/com/posts/PostFeedErrorMessage.tsx @@ -9,7 +9,7 @@ import {useNavigation} from '@react-navigation/native' import {usePalette} from '#/lib/hooks/usePalette' import {type NavigationProp} from '#/lib/routes/types' import {cleanError} from '#/lib/strings/errors' -import {getErrorName} from '#/lib/xrpc-error' +import {getErrorName, getErrorStatus} from '#/lib/xrpc-error' import {logger} from '#/logger' import {type FeedDescriptor} from '#/state/queries/post-feed' import {useRemoveFeedMutation} from '#/state/queries/preferences' @@ -247,7 +247,7 @@ function detectKnownError( } // check status codes - if (error?.status === 429) { + if (getErrorStatus(error) === 429) { return KnownError.FeedTooManyRequests }