[SDK] Validate and brand the persisted account did (#11387)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-13 22:26:22 +03:00
committed by GitHub
parent 9fe0084874
commit 3677c98873
46 changed files with 154 additions and 205 deletions
+3 -4
View File
@@ -1,7 +1,7 @@
import {useMemo} from 'react'
import {retry} from '@atproto/common-web'
import {type $Typed, type l, type UriString} from '@atproto/lex'
import {type AtIdentifierString, AtUri, toDatetimeString} from '@atproto/syntax'
import {AtUri, toDatetimeString} from '@atproto/syntax'
import {moderateStatus} from '@bsky.app/sdk/moderation'
import {msg} from '@lingui/core/macro'
import {useLingui} from '@lingui/react'
@@ -276,8 +276,7 @@ export function useUpsertLiveStatusMutation(
} satisfies app.bsky.actor.status.Main
const upsert = async () => {
// the session account is still legacy-typed, so its did is unbranded
const repo = currentAccount.did as AtIdentifierString
const repo = currentAccount.did
const collection = 'app.bsky.actor.status'
const existing = await pdsClient
@@ -369,7 +368,7 @@ export function useRemoveLiveStatusMutation() {
if (!currentAccount) throw new Error('Not logged in')
await pdsClient.delete(app.bsky.actor.status, {
repo: currentAccount.did as AtIdentifierString,
repo: currentAccount.did,
rkey: 'self',
})
},