diff --git a/src/connectors/__test__/commentService.test.ts b/src/connectors/__test__/commentService.test.ts index 7fc228319..0ef2a3d33 100644 --- a/src/connectors/__test__/commentService.test.ts +++ b/src/connectors/__test__/commentService.test.ts @@ -940,6 +940,8 @@ describe('spam telegram alert (notify-only tiering)', () => { reason: 'spam_auto', dedupeKey: `comment:${comment.id}`, }) + // carries an OSS deep-link for one-click moderation + expect(sent[0].ossUrl).toContain('/comments?id=') }) test('emits Tier C (spam_review) for high-score benign-looking content', async () => { diff --git a/src/connectors/commentService.ts b/src/connectors/commentService.ts index b45f8d4b8..2287666ff 100644 --- a/src/connectors/commentService.ts +++ b/src/connectors/commentService.ts @@ -23,6 +23,7 @@ import { USER_ACTION, USER_FEATURE_FLAG_TYPE, NOTICE_TYPE, + NODE_TYPES, } from '#common/enums/index.js' import { environment } from '#common/environment.js' import { @@ -32,6 +33,7 @@ import { UserInputError, } from '#common/errors.js' import { enqueueReportAlert } from '#common/notifications/reportAlert.js' +import { toGlobalId } from '#common/utils/index.js' import { v4 } from 'uuid' import { BaseService } from './baseService.js' @@ -1037,6 +1039,7 @@ export class CommentService extends BaseService { const author = await this.models.userIdLoader.load(comment.authorId) const snippet = stripHtml(content).slice(0, 80) + const globalId = toGlobalId({ type: NODE_TYPES.Comment, id }) await enqueueReportAlert({ source: 'spam_detection', dedupeKey: `comment:${id}`, @@ -1044,6 +1047,9 @@ export class CommentService extends BaseService { 2 )}):${snippet}`, reason: TIER_REASON[tier], + ossUrl: `${environment.ossSiteDomain}/comments?id=${encodeURIComponent( + globalId + )}`, }) }