Make deleted-comment cleanup atomic

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Dotta
2026-06-05 03:56:39 +00:00
parent 1afa337841
commit 9aa065a38c
5 changed files with 161 additions and 85 deletions
+8 -1
View File
@@ -34,6 +34,7 @@ import {
} from "@paperclipai/db";
import type {
AcceptedPlanDecomposition,
IssueComment,
IssueCommentAuthorType,
IssueCommentMetadata,
IssueCommentPresentation,
@@ -5733,6 +5734,9 @@ export function issueService(db: Db) {
userId?: string | null;
runId?: string | null;
},
options?: {
afterTombstone?: (comment: IssueComment, tx: any) => Promise<void>;
},
) => {
const currentUserRedactionOptions = {
enabled: (await instanceSettings.getGeneral()).censorUsernameInLogs,
@@ -5763,7 +5767,10 @@ export function issueService(db: Db) {
.set({ updatedAt: now })
.where(eq(issues.id, comment.issueId));
return redactIssueComment(comment, currentUserRedactionOptions.enabled);
const redacted = redactIssueComment(comment, currentUserRedactionOptions.enabled);
await options?.afterTombstone?.(redacted, tx);
return redacted;
});
},