From edaeae0fcf790602309cd99e8935fbe999059afd Mon Sep 17 00:00:00 2001 From: Rudy Fraser Date: Fri, 13 Feb 2026 13:51:44 -0500 Subject: [PATCH] Make Blacksky labeler non-removable like Bluesky Moderation - Filter BLACKSKY_LABELER from custom labeler headers (auto-included via appLabelers) - Prevent unsubscribing from any app labeler in the subscription mutation --- src/state/queries/labeler.ts | 4 ++++ src/state/session/moderation.ts | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/state/queries/labeler.ts b/src/state/queries/labeler.ts index 465a2b57a..076627a0d 100644 --- a/src/state/queries/labeler.ts +++ b/src/state/queries/labeler.ts @@ -3,6 +3,7 @@ import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query' import {z} from 'zod' import {MAX_LABELERS} from '#/lib/constants' +import {isAppLabeler} from '#/lib/moderation' import { PERSISTED_QUERY_GCTIME, PERSISTED_QUERY_ROOT, @@ -136,6 +137,9 @@ export function useLabelerSubscriptionMutation() { } await agent.addLabeler(did) } else { + if (isAppLabeler(did)) { + return + } await agent.removeLabeler(did) } }, diff --git a/src/state/session/moderation.ts b/src/state/session/moderation.ts index 6b67384bb..a10d7ba58 100644 --- a/src/state/session/moderation.ts +++ b/src/state/session/moderation.ts @@ -3,7 +3,10 @@ import {BSKY_LABELER_DID, BskyAgent} from '@atproto/api' import {IS_TEST_USER} from '#/lib/constants' import {getNoAppLabelers} from '../preferences/no-app-labelers' -import {configureAdditionalModerationAuthorities} from './additional-moderation-authorities' +import { + BLACKSKY_LABELER, + configureAdditionalModerationAuthorities, +} from './additional-moderation-authorities' import {readLabelers} from './agent-config' import {type SessionAccount} from './types' @@ -29,7 +32,9 @@ export async function configureModerationForAccount( const labelerDids = await readLabelers(account.did).catch(_ => {}) if (labelerDids) { agent.configureLabelersHeader( - labelerDids.filter(did => did !== BSKY_LABELER_DID), + labelerDids.filter( + did => did !== BSKY_LABELER_DID && did !== BLACKSKY_LABELER, + ), ) } else { // If there are no headers in the storage, we'll not send them on the initial requests. -- knotmirror 0.0.1