A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
feat(api): moderate and expire operators' wall entries
Hampus779187fd0de6
diff --git a/fluxer_api/src/api/operator_pass/OperatorPassWallModerationService.ts b/fluxer_api/src/api/operator_pass/OperatorPassWallModerationService.tsnew file mode 100644index 000000000..294947dd6--- /dev/null+++ b/fluxer_api/src/api/operator_pass/OperatorPassWallModerationService.ts@@ -0,0 +1,361 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {randomUUID} from 'node:crypto';+import type {UserID} from '@app/api/BrandedTypes';+import {Db} from '@app/api/database/CassandraTypes';+import type {+ OperatorPassWallDecisionRow,+ OperatorPassWallDeclineReason,+ OperatorPassWallEntryRow,+ OperatorPassWallRevisionRow,+} from '@app/api/database/types/OperatorPassTypes';+import type {User} from '@app/api/models/User';+import type {OperatorPassRepository} from '@app/api/operator_pass/OperatorPassRepository';+import {operatorPassNow} from '@app/api/operator_pass/OperatorPassSchedule';+import {liveRevisionPatch, type OperatorPassWallEntryStore} from '@app/api/operator_pass/OperatorPassWallEntryStore';+import {revisionStatuses} from '@app/api/operator_pass/OperatorPassWallHistory';+import {isOperatorPassWallListed} from '@app/api/operator_pass/OperatorPassWallPresentation';+import type {OperatorPassWallPublicationService} from '@app/api/operator_pass/OperatorPassWallPublicationService';+import type {UserRepository} from '@app/api/user/repositories/UserRepository';+import {mapWithConcurrency} from '@app/api/utils/ConcurrencyUtils';+import {InputValidationError} from '@fluxer/errors/src/domains/core/InputValidationError';+import {UnknownOperatorPassWallEntryError} from '@fluxer/errors/src/domains/operator_pass/UnknownOperatorPassWallEntryError';+import {compareSnowflakes} from '@fluxer/snowflake/src/SnowflakeComparison';++const PENDING_LOOKUP_CONCURRENCY = 16;++interface OperatorPassWallDecisionInput {+ reason: OperatorPassWallDeclineReason;+ note: string;+ usernameDeclined: boolean;+}++export interface OperatorPassWallDecisionResult {+ entry: OperatorPassWallEntryRow;+ revision: OperatorPassWallRevisionRow | null;+ decision: OperatorPassWallDecisionRow;+}++export class OperatorPassWallModerationService {+ constructor(+ private readonly repository: OperatorPassRepository,+ private readonly userRepository: UserRepository,+ private readonly entries: OperatorPassWallEntryStore,+ private readonly publication: OperatorPassWallPublicationService,+ ) {}++ async approve(userId: UserID, adminId: UserID, revisionId?: bigint): Promise<OperatorPassWallDecisionResult> {+ const entry = await this.requireListed(userId);+ const targetId = revisionId ?? entry.pending_revision_id;+ if (targetId == null || targetId !== entry.pending_revision_id) {+ throw new UnknownOperatorPassWallEntryError();+ }+ const revision = await this.findRevision(userId, targetId);+ const now = operatorPassNow();+ let previousAvatar: string | null = null;+ const next = await this.entries.mutate(userId, now, adminId, (current) => {+ if (!isOperatorPassWallListed(current) || current.pending_revision_id !== targetId) {+ throw new UnknownOperatorPassWallEntryError();+ }+ previousAvatar = current.live_avatar ?? null;+ return {+ patch: {+ ...liveRevisionPatch(revision),+ pending_revision_id: Db.set(null),+ pending_name: Db.set(null),+ pending_avatar: Db.set(null),+ pending_source: Db.set(null),+ pending_since: Db.set(null),+ declined_revision_id: Db.set(null),+ declined_name: Db.set(null),+ declined_avatar: Db.set(null),+ decline_reason: Db.set(null),+ decline_note: Db.set(null),+ decline_statement_id: Db.set(null),+ username_declined: Db.set(false),+ reviewed_at: Db.set(now),+ reviewed_by: Db.set(adminId),+ updated_at: Db.set(now),+ },+ events: [{kind: 'approved', name: revision.name}],+ };+ });+ const decision = await this.entries.appendDecision(userId, {+ kind: 'approve',+ revisionId: targetId,+ decidedBy: adminId,+ decidedAt: now,+ });+ await this.publication.publishAvatarIfServed(next);+ await this.publication.publishChanges([userId], 'preserve');+ if (previousAvatar && previousAvatar !== revision.avatar) {+ await this.publication.releaseAvatar(previousAvatar);+ }+ return {entry: next, revision, decision};+ }++ async decline(+ userId: UserID,+ adminId: UserID,+ input: OperatorPassWallDecisionInput,+ ): Promise<OperatorPassWallDecisionResult> {+ const entry = await this.requireListed(userId);+ const targetId = entry.pending_revision_id;+ if (targetId == null) {+ throw new UnknownOperatorPassWallEntryError();+ }+ const revision = await this.findRevision(userId, targetId);+ const now = operatorPassNow();+ const statementId = randomUUID();+ let usernameWasDeclined = false;+ const next = await this.entries.mutate(userId, now, adminId, (current) => {+ if (!isOperatorPassWallListed(current) || current.pending_revision_id !== targetId) {+ throw new UnknownOperatorPassWallEntryError();+ }+ usernameWasDeclined = current.username_declined;+ return {+ patch: {+ pending_revision_id: Db.set(null),+ pending_name: Db.set(null),+ pending_avatar: Db.set(null),+ pending_source: Db.set(null),+ pending_since: Db.set(null),+ declined_revision_id: Db.set(targetId),+ declined_name: Db.set(revision.name),+ declined_avatar: Db.set(revision.avatar ?? null),+ decline_reason: Db.set(input.reason),+ decline_note: Db.set(input.note),+ decline_statement_id: Db.set(statementId),+ username_declined: Db.set(current.username_declined || input.usernameDeclined),+ reviewed_at: Db.set(now),+ reviewed_by: Db.set(adminId),+ updated_at: Db.set(now),+ },+ events: [{kind: 'declined', name: revision.name, reason: input.reason}],+ };+ });+ const decision = await this.entries.appendDecision(userId, {+ kind: 'decline',+ revisionId: targetId,+ decidedBy: adminId,+ decidedAt: now,+ reason: input.reason,+ note: input.note,+ statementId,+ usernameDeclined: input.usernameDeclined,+ });+ if (input.usernameDeclined && !usernameWasDeclined && next.live_revision_id == null) {+ await this.publication.publishChanges([userId], 'preserve');+ }+ return {entry: next, revision, decision};+ }++ async revert(userId: UserID, adminId: UserID, revisionId: bigint): Promise<OperatorPassWallDecisionResult> {+ const entry = await this.requireListed(userId);+ const [revisions, decisions] = await Promise.all([+ this.repository.listWallRevisions(userId),+ this.repository.listWallDecisions(userId),+ ]);+ const statuses = revisionStatuses(revisions, decisions);+ const target = revisions.find((revision) => revision.revision_id === revisionId);+ const status = statuses.get(revisionId)?.status;+ const everApproved = decisions.some(+ (decision) => decision.kind === 'approve' && decision.revision_id === revisionId,+ );+ if (!target || !everApproved || status === 'declined') {+ throw new UnknownOperatorPassWallEntryError();+ }+ if (target.business) {+ throw InputValidationError.create(+ 'revision_id',+ 'A business listing cannot come back through a revert. Set it as a business listing again so the purchase is checked.',+ );+ }+ const now = operatorPassNow();+ let previousAvatar: string | null = null;+ const next = await this.entries.mutate(userId, now, adminId, (current) => {+ if (!isOperatorPassWallListed(current) || current.live_revision_id !== entry.live_revision_id) {+ throw new UnknownOperatorPassWallEntryError();+ }+ previousAvatar = current.live_avatar ?? null;+ return {+ patch: {...liveRevisionPatch(target), updated_at: Db.set(now)},+ events: [{kind: 'approved', name: target.name, reason: 'revert'}],+ };+ });+ const decision = await this.entries.appendDecision(userId, {+ kind: 'revert',+ revisionId,+ decidedBy: adminId,+ decidedAt: now,+ });+ await this.publication.publishAvatarIfServed(next);+ await this.publication.publishChanges([userId], 'preserve');+ if (previousAvatar && previousAvatar !== target.avatar) {+ await this.publication.releaseAvatar(previousAvatar);+ }+ return {entry: next, revision: target, decision};+ }++ async forceFallback(+ userId: UserID,+ adminId: UserID,+ input: OperatorPassWallDecisionInput,+ ): Promise<OperatorPassWallDecisionResult> {+ const entry = await this.requireListed(userId);+ const personal = entry.live_business ? await this.lastPersonalRevision(userId) : null;+ const now = operatorPassNow();+ const statementId = randomUUID();+ let previousAvatar: string | null = null;+ const next = await this.entries.mutate(userId, now, adminId, (current) => {+ if (!isOperatorPassWallListed(current) || current.live_revision_id !== entry.live_revision_id) {+ throw new UnknownOperatorPassWallEntryError();+ }+ previousAvatar = current.live_avatar ?? null;+ return {+ patch: {+ ...liveRevisionPatch(personal),+ username_declined: Db.set(current.username_declined || input.usernameDeclined),+ decline_reason: Db.set(input.reason),+ decline_note: Db.set(input.note),+ decline_statement_id: Db.set(statementId),+ updated_at: Db.set(now),+ },+ events: [{kind: 'fallback', name: personal?.name ?? null, reason: input.reason}],+ };+ });+ const decision = await this.entries.appendDecision(userId, {+ kind: 'force_fallback',+ revisionId: entry.live_revision_id ?? null,+ decidedBy: adminId,+ decidedAt: now,+ reason: input.reason,+ note: input.note,+ statementId,+ usernameDeclined: input.usernameDeclined,+ });+ if (personal) {+ await this.recordBusinessEnded(userId, null, personal, adminId, now);+ await this.publication.publishAvatarIfServed(next);+ }+ await this.publication.publishChanges([userId], 'preserve');+ if (previousAvatar && previousAvatar !== personal?.avatar) {+ await this.publication.releaseAvatar(previousAvatar);+ }+ return {entry: next, revision: personal, decision};+ }++ async setHidden(+ userId: UserID,+ adminId: UserID,+ hidden: boolean,+ input: {reason: OperatorPassWallDeclineReason | null; note: string | null},+ ): Promise<OperatorPassWallDecisionResult> {+ await this.requireListed(userId);+ const now = operatorPassNow();+ const next = await this.entries.mutate(userId, now, adminId, (current) => {+ if (!isOperatorPassWallListed(current)) {+ throw new UnknownOperatorPassWallEntryError();+ }+ const liveName = current.live_name ?? null;+ return {+ patch: {hidden: Db.set(hidden), updated_at: Db.set(now)},+ events: [+ hidden+ ? {kind: 'taken_down', name: liveName, cause: 'hidden', reason: input.reason}+ : {kind: 'shown_again', name: liveName},+ ],+ };+ });+ const decision = await this.entries.appendDecision(userId, {+ kind: hidden ? 'hide' : 'unhide',+ revisionId: null,+ decidedBy: adminId,+ decidedAt: now,+ reason: input.reason,+ note: input.note,+ statementId: hidden ? randomUUID() : null,+ });+ await this.publication.publishChanges([userId]);+ if (hidden && next.live_avatar) {+ await this.publication.releaseAvatar(next.live_avatar);+ }+ if (!hidden) {+ await this.publication.publishAvatarIfServed(next);+ }+ return {entry: next, revision: null, decision};+ }++ async listPending(): Promise<Array<{entry: OperatorPassWallEntryRow; user: User | null}>> {+ const rows = await mapWithConcurrency(+ await this.repository.listWallPending(),+ PENDING_LOOKUP_CONCURRENCY,+ (userId) => this.repository.findWallEntry(userId),+ );+ const entries = rows.filter(+ (entry): entry is OperatorPassWallEntryRow =>+ entry != null && entry.pending_revision_id != null && isOperatorPassWallListed(entry),+ );+ entries.sort((left, right) => (left.pending_since?.getTime() ?? 0) - (right.pending_since?.getTime() ?? 0));+ return Promise.all(+ entries.map(async (entry) => ({entry, user: await this.userRepository.findUnique(entry.user_id)})),+ );+ }++ async lastPersonalRevision(userId: UserID): Promise<OperatorPassWallRevisionRow | null> {+ const [revisions, decisions] = await Promise.all([+ this.repository.listWallRevisions(userId),+ this.repository.listWallDecisions(userId),+ ]);+ const personal = new Map(+ revisions.filter((revision) => !revision.business).map((revision) => [revision.revision_id, revision]),+ );+ const removed = new Set<bigint>();+ let latest: OperatorPassWallRevisionRow | null = null;+ for (const decision of [...decisions].sort((left, right) =>+ compareSnowflakes(left.decision_id, right.decision_id),+ )) {+ const revision = decision.revision_id != null ? personal.get(decision.revision_id) : undefined;+ if (!revision) {+ continue;+ }+ if (decision.kind === 'decline' || decision.kind === 'force_fallback') {+ removed.add(revision.revision_id);+ } else if (decision.kind === 'approve' || decision.kind === 'revert') {+ latest = revision;+ }+ }+ return latest && !removed.has(latest.revision_id) ? latest : null;+ }++ async recordBusinessEnded(+ userId: UserID,+ businessRevisionId: bigint | null,+ personal: OperatorPassWallRevisionRow | null,+ decidedBy: UserID | null,+ decidedAt: Date,+ ): Promise<void> {+ await this.entries.appendDecision(userId, {+ kind: personal ? 'revert' : 'force_fallback',+ revisionId: personal?.revision_id ?? businessRevisionId,+ decidedBy,+ decidedAt,+ });+ }++ private async requireListed(userId: UserID): Promise<OperatorPassWallEntryRow> {+ const entry = await this.repository.findWallEntry(userId);+ if (!entry || !isOperatorPassWallListed(entry)) {+ throw new UnknownOperatorPassWallEntryError();+ }+ return entry;+ }++ private async findRevision(userId: UserID, revisionId: bigint): Promise<OperatorPassWallRevisionRow> {+ const revision = (await this.repository.listWallRevisions(userId)).find((row) => row.revision_id === revisionId);+ if (!revision) {+ throw new UnknownOperatorPassWallEntryError();+ }+ return revision;+ }+}diff --git a/fluxer_api/src/api/operator_pass/OperatorPassWallRetentionService.ts b/fluxer_api/src/api/operator_pass/OperatorPassWallRetentionService.tsnew file mode 100644index 000000000..3e97af4f3--- /dev/null+++ b/fluxer_api/src/api/operator_pass/OperatorPassWallRetentionService.ts@@ -0,0 +1,249 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {createHmac} from 'node:crypto';+import type {AdminRepository} from '@app/api/admin/AdminRepository';+import type {UserID} from '@app/api/BrandedTypes';+import {Db} from '@app/api/database/CassandraTypes';+import type {+ OperatorPassWallDecisionRow,+ OperatorPassWallEntryRow,+ OperatorPassWallRevisionRow,+} from '@app/api/database/types/OperatorPassTypes';+import {Logger} from '@app/api/Logger';+import {getOperatorPassWallInfrastructure} from '@app/api/middleware/ServiceSingletons';+import type {OperatorPassRepository} from '@app/api/operator_pass/OperatorPassRepository';+import {operatorPassNow} from '@app/api/operator_pass/OperatorPassSchedule';+import {deriveOperatorPassSecret} from '@app/api/operator_pass/OperatorPassSecrets';+import {liveRevisionPatch, type OperatorPassWallEntryStore} from '@app/api/operator_pass/OperatorPassWallEntryStore';+import {isOperatorPassWallListed} from '@app/api/operator_pass/OperatorPassWallPresentation';+import type {OperatorPassWallPublicationService} from '@app/api/operator_pass/OperatorPassWallPublicationService';+import {getAuditLogSearchService} from '@app/api/SearchFactory';+import {MS_PER_DAY} from '@fluxer/date_utils/src/DateConstants';++const WALL_SUBMISSION_EVENT_KINDS: ReadonlySet<string> = new Set(['declined', 'changed', 'listed']);++const DECLINED_RETENTION_MS = 365 * MS_PER_DAY;++const LEFT_WALL_RETENTION_MS = 60 * MS_PER_DAY;++export class OperatorPassWallRetentionService {+ constructor(+ private readonly repository: OperatorPassRepository,+ private readonly entries: OperatorPassWallEntryStore,+ private readonly publication: OperatorPassWallPublicationService,+ private readonly auditLogs: AdminRepository,+ ) {}++ async setLegalHold(userId: UserID, adminId: UserID, held: boolean): Promise<OperatorPassWallEntryRow> {+ const now = operatorPassNow();+ return this.entries.mutateExisting(userId, now, adminId, (current) => {+ if (current.legal_hold === held) {+ return null;+ }+ return {+ patch: {legal_hold: Db.set(held), updated_at: Db.set(now)},+ events: [{kind: held ? 'legal_hold_set' : 'legal_hold_cleared'}],+ };+ });+ }++ async purgeExpired(+ params: {now?: Date; isOnHold?: (userId: UserID) => Promise<boolean>} = {},+ ): Promise<{redacted: number; purged: number}> {+ const now = params.now ?? operatorPassNow();+ let redacted = 0;+ let purged = 0;+ for (const entry of await this.entries.scanAll()) {+ if (entry.legal_hold || (params.isOnHold && (await params.isOnHold(entry.user_id)))) {+ continue;+ }+ const [revisions, decisions] = await Promise.all([+ this.repository.listWallRevisions(entry.user_id),+ this.repository.listWallDecisions(entry.user_id),+ ]);+ const left =+ !isOperatorPassWallListed(entry) &&+ entry.left_wall_at != null &&+ now.getTime() - entry.left_wall_at.getTime() >= LEFT_WALL_RETENTION_MS;+ if (left && entry.delivered_at != null) {+ if (await this.redactLeftHolder(entry, revisions, decisions)) {+ redacted += 1;+ }+ continue;+ }+ if (left) {+ for (const avatar of new Set(revisions.flatMap((revision) => (revision.avatar ? [revision.avatar] : [])))) {+ await this.forgetAvatarCopy(avatar, entry.user_id);+ }+ const userId = entry.user_id;+ const digest = createHmac('sha256', deriveOperatorPassSecret('fluxer-operator-pass-wall-token-v1'))+ .update(userId.toString())+ .digest('hex');+ const token = -BigInt(`0x${digest.slice(0, 15)}`);+ for (const decision of decisions) {+ await this.repository.saveWallDecision({+ ...decision,+ user_id: token as UserID,+ decided_by: decision.decided_by === entry.user_id ? null : decision.decided_by,+ note: null,+ statement_id: decision.statement_id,+ });+ }+ for (const event of await this.repository.listWallEvents(entry.user_id)) {+ await this.repository.appendWallEvent({+ ...event,+ user_id: token as UserID,+ name: null,+ reason: null,+ actor_id: event.actor_id === entry.user_id ? null : event.actor_id,+ purchase_id: null,+ });+ }+ for (const logId of await this.repository.listWallAuditLogIds(entry.user_id)) {+ await this.redactAuditLog(logId, token, ['sha256', 'note']);+ }+ await this.repository.saveWallTombstone({token_: token, left_at: entry.left_wall_at!, purged_at: now});+ await this.repository.setWallPending(entry.user_id, false);+ await this.repository.deleteWallPartitions(entry.user_id);+ purged += 1;+ continue;+ }+ for (const decision of decisions) {+ if (decision.kind !== 'decline' || decision.revision_id == null) continue;+ if (now.getTime() - decision.decided_at.getTime() < DECLINED_RETENTION_MS) continue;+ const revision = revisions.find((row) => row.revision_id === decision.revision_id);+ if (!revision || (revision.name === '' && revision.avatar == null)) continue;+ await this.redactDeclinedRevision(entry, revision, revisions);+ await this.repository.saveWallDecision({...decision, note: null});+ redacted += 1;+ }+ }+ return {redacted, purged};+ }++ private async forgetAvatarCopy(avatar: string, userId: UserID): Promise<void> {+ await this.repository.removeWallAvatarRef(avatar, userId);+ if (!(await this.publication.isAvatarServed(avatar))) {+ await getOperatorPassWallInfrastructure().avatarStore.unpublish(avatar);+ }+ if ((await this.repository.listWallAvatarRefs(avatar)).length === 0) {+ await getOperatorPassWallInfrastructure().avatarStore.deletePrivate(avatar);+ }+ }++ private async redactLeftHolder(+ entry: OperatorPassWallEntryRow,+ revisions: ReadonlyArray<OperatorPassWallRevisionRow>,+ decisions: ReadonlyArray<OperatorPassWallDecisionRow>,+ ): Promise<boolean> {+ const userId = entry.user_id;+ const copies = revisions.filter((revision) => revision.name !== '' || revision.avatar != null);+ if (copies.length === 0 && entry.name == null) {+ return false;+ }+ for (const avatar of new Set(copies.flatMap((revision) => (revision.avatar ? [revision.avatar] : [])))) {+ await this.forgetAvatarCopy(avatar, userId);+ }+ for (const revision of copies) {+ await this.repository.saveWallRevision({...revision, name: '', avatar: null});+ }+ for (const decision of decisions) {+ if (decision.note != null) {+ await this.repository.saveWallDecision({...decision, note: null});+ }+ }+ for (const event of await this.repository.listWallEvents(userId)) {+ if (event.name != null) {+ await this.repository.appendWallEvent({...event, name: null});+ }+ }+ for (const logId of await this.repository.listWallAuditLogIds(userId)) {+ await this.redactAuditLog(logId, userId, ['sha256', 'note']);+ }+ await this.entries.mutateExisting(userId, operatorPassNow(), null, () => ({+ patch: {+ name: Db.set(null),+ ...liveRevisionPatch(null),+ pending_revision_id: Db.set(null),+ pending_name: Db.set(null),+ pending_avatar: Db.set(null),+ pending_source: Db.set(null),+ pending_since: Db.set(null),+ declined_revision_id: Db.set(null),+ declined_name: Db.set(null),+ declined_avatar: Db.set(null),+ decline_note: Db.set(null),+ },+ events: [],+ }));+ return true;+ }++ private async redactDeclinedRevision(+ entry: OperatorPassWallEntryRow,+ revision: OperatorPassWallRevisionRow,+ revisions: ReadonlyArray<OperatorPassWallRevisionRow>,+ ): Promise<void> {+ const userId = entry.user_id;+ const others = revisions.filter((row) => row.revision_id !== revision.revision_id);+ if (revision.avatar && !others.some((row) => row.avatar === revision.avatar)) {+ await this.repository.removeWallAvatarRef(revision.avatar, userId);+ if (+ !(await this.publication.isAvatarServed(revision.avatar)) &&+ (await this.repository.listWallAvatarRefs(revision.avatar)).length === 0+ ) {+ await getOperatorPassWallInfrastructure().avatarStore.deletePrivate(revision.avatar);+ }+ }+ await this.repository.saveWallRevision({...revision, name: '', avatar: null});+ if (entry.declined_revision_id === revision.revision_id) {+ await this.entries.mutateExisting(userId, operatorPassNow(), null, (current) =>+ current.declined_revision_id === revision.revision_id+ ? {+ patch: {+ declined_name: Db.set(null),+ declined_avatar: Db.set(null),+ decline_note: Db.set(null),+ },+ events: [],+ }+ : null,+ );+ }+ const keptNames = new Set(+ [entry.live_name, entry.pending_name, ...others.map((row) => row.name)].filter((name): name is string =>+ Boolean(name),+ ),+ );+ if (revision.name && !keptNames.has(revision.name)) {+ for (const event of await this.repository.listWallEvents(userId)) {+ if (event.name === revision.name && WALL_SUBMISSION_EVENT_KINDS.has(event.kind)) {+ await this.repository.appendWallEvent({...event, name: null});+ }+ }+ }+ for (const logId of await this.repository.listWallAuditLogIds(userId)) {+ const log = await this.auditLogs.getAuditLog(logId);+ if (!log) continue;+ const dropKeys: Array<string> = [];+ if (log.metadata.get('revision_id') === revision.revision_id.toString() && log.metadata.has('note')) {+ dropKeys.push('note');+ }+ if (revision.avatar && log.metadata.get('sha256') === revision.avatar) {+ dropKeys.push('sha256');+ }+ if (dropKeys.length > 0) {+ await this.redactAuditLog(logId, log.targetId, dropKeys);+ }+ }+ }++ private async redactAuditLog(logId: bigint, targetId: bigint, dropKeys: ReadonlyArray<string>): Promise<void> {+ const updated = await this.auditLogs.redactAuditLog(logId, targetId, dropKeys);+ if (updated) {+ await getAuditLogSearchService()+ ?.indexAuditLog(updated)+ .catch((error) => Logger.warn({error, logId}, "Failed to reindex a redacted Operators' wall audit log"));+ }+ }+}