move labeler cache to mmkv, make moderation config sync

The per-account labeler cache was the only async dependency in
configureModerationForAccount. MMKV-backed sync reads let session
setup apply labelers in the same tick. No AsyncStorage backfill: the
cache is rewritten on every preferences fetch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-07-31 19:01:05 +03:00
parent e79d8e8e52
commit 045f3965ec
5 changed files with 51 additions and 24 deletions
+11
View File
@@ -108,4 +108,15 @@ export type Account = {
* account after a switch, until that account's preferences loaded.
*/
isBetaUser?: boolean
/**
* The account's subscribed labeler DIDs, cached from preferences so the
* `atproto-accept-labelers` header can be configured synchronously at
* session start, before preferences load. Eventually consistent: rewritten
* on every preferences fetch (see `saveLabelers` in
* `#/state/session/moderation`). Until the first fetch lands there is
* simply no cache entry and initial requests go out without per-account
* labeler headers.
*/
labelers?: string[]
}