diff --git a/src/core/client/admin/components/ModerateCard/MarkersContainer.spec.tsx b/src/core/client/admin/components/ModerateCard/MarkersContainer.spec.tsx
index cc6f3a146..1c2ab90bb 100644
--- a/src/core/client/admin/components/ModerateCard/MarkersContainer.spec.tsx
+++ b/src/core/client/admin/components/ModerateCard/MarkersContainer.spec.tsx
@@ -32,6 +32,11 @@ it("renders all markers", () => {
},
},
},
+ metadata: {
+ wordList: {
+ timedOut: false,
+ },
+ },
},
},
settings: {
@@ -71,6 +76,11 @@ it("renders some markers", () => {
},
},
},
+ metadata: {
+ wordList: {
+ timedOut: false,
+ },
+ },
},
},
settings: {
diff --git a/src/core/client/admin/components/ModerateCard/MarkersContainer.tsx b/src/core/client/admin/components/ModerateCard/MarkersContainer.tsx
index 7d1ab0080..c441da276 100644
--- a/src/core/client/admin/components/ModerateCard/MarkersContainer.tsx
+++ b/src/core/client/admin/components/ModerateCard/MarkersContainer.tsx
@@ -38,7 +38,17 @@ const markers: Array<(
null,
(c) =>
(c.revision &&
- c.revision.actionCounts.flag.reasons.COMMENT_DETECTED_BANNED_WORD && (
+ c.revision.actionCounts.flag.reasons.COMMENT_DETECTED_BANNED_WORD &&
+ c.revision.metadata?.wordList?.timedOut && (
+
+ Possible Banned Word
+
+ )) ||
+ null,
+ (c) =>
+ (c.revision &&
+ c.revision.actionCounts.flag.reasons.COMMENT_DETECTED_BANNED_WORD &&
+ !c.revision.metadata?.wordList?.timedOut && (
Banned Word
@@ -46,7 +56,17 @@ const markers: Array<(
null,
(c) =>
(c.revision &&
- c.revision.actionCounts.flag.reasons.COMMENT_DETECTED_SUSPECT_WORD && (
+ c.revision.actionCounts.flag.reasons.COMMENT_DETECTED_SUSPECT_WORD &&
+ c.revision.metadata?.wordList?.timedOut && (
+
+ Possible Suspect Word
+
+ )) ||
+ null,
+ (c) =>
+ (c.revision &&
+ c.revision.actionCounts.flag.reasons.COMMENT_DETECTED_SUSPECT_WORD &&
+ !c.revision.metadata?.wordList?.timedOut && (
Suspect Word
@@ -193,6 +213,11 @@ const enhanced = withFragmentContainer({
}
}
}
+ metadata {
+ wordList {
+ timedOut
+ }
+ }
}
}
`,
diff --git a/src/core/client/admin/components/ModerateCard/__snapshots__/MarkersContainer.spec.tsx.snap b/src/core/client/admin/components/ModerateCard/__snapshots__/MarkersContainer.spec.tsx.snap
index 0a40f90b3..1b1eab619 100644
--- a/src/core/client/admin/components/ModerateCard/__snapshots__/MarkersContainer.spec.tsx.snap
+++ b/src/core/client/admin/components/ModerateCard/__snapshots__/MarkersContainer.spec.tsx.snap
@@ -25,6 +25,11 @@ exports[`renders all markers 1`] = `
},
},
},
+ "metadata": Object {
+ "wordList": Object {
+ "timedOut": false,
+ },
+ },
},
"status": "PREMOD",
}
@@ -172,6 +177,11 @@ exports[`renders some markers 1`] = `
},
},
},
+ "metadata": Object {
+ "wordList": Object {
+ "timedOut": false,
+ },
+ },
},
"status": "PREMOD",
}
diff --git a/src/core/server/graph/schema/schema.graphql b/src/core/server/graph/schema/schema.graphql
index 94bd5f043..1e6e39e8e 100644
--- a/src/core/server/graph/schema/schema.graphql
+++ b/src/core/server/graph/schema/schema.graphql
@@ -2655,12 +2655,26 @@ type CommentRevisionPerspectiveMetadata {
score: Float!
}
+type CommentRevisionWordListMetadata {
+ """
+ timedOut is whether the wordlist analysis timed out when this revision
+ of the comment was sent through the moderation phases.
+ """
+ timedOut: Boolean
+}
+
type CommentRevisionMetadata {
"""
perspective stores metadata associated with the pipeline analysis of this
revision's body.
"""
perspective: CommentRevisionPerspectiveMetadata
+
+ """
+ wordList metadata stores extra status details about what occurred during
+ word list analysis of this comment revision.
+ """
+ wordList: CommentRevisionWordListMetadata
}
"""
diff --git a/src/core/server/models/comment/revision.ts b/src/core/server/models/comment/revision.ts
index 0738c6f4d..887df1983 100644
--- a/src/core/server/models/comment/revision.ts
+++ b/src/core/server/models/comment/revision.ts
@@ -28,6 +28,18 @@ export interface RevisionMetadata {
model: string;
};
+ /**
+ * wordList metadata stores extra status details about what occurred during
+ * word list analysis of this comment revision.
+ */
+ wordList?: {
+ /**
+ * timedOut is whether the wordlist analysis timed out when this revision
+ * of the comment was sent through the moderation phases.
+ */
+ timedOut?: boolean;
+ };
+
/**
* nudge when true indicates that the comment was written on the first try
* without a warning.
diff --git a/src/core/server/services/comments/pipeline/phases/wordList.ts b/src/core/server/services/comments/pipeline/phases/wordList.ts
index 0e6c162b0..768785522 100755
--- a/src/core/server/services/comments/pipeline/phases/wordList.ts
+++ b/src/core/server/services/comments/pipeline/phases/wordList.ts
@@ -43,13 +43,17 @@ export const wordList: IntermediateModerationPhase = ({
};
} else if (banned === null) {
return {
- status: GQLCOMMENT_STATUS.SYSTEM_WITHHELD,
actions: [
{
actionType: ACTION_TYPE.FLAG,
reason: GQLCOMMENT_FLAG_REASON.COMMENT_DETECTED_BANNED_WORD,
},
],
+ metadata: {
+ wordList: {
+ timedOut: true,
+ },
+ },
};
}
@@ -66,13 +70,17 @@ export const wordList: IntermediateModerationPhase = ({
};
} else if (suspect === null) {
return {
- status: GQLCOMMENT_STATUS.SYSTEM_WITHHELD,
actions: [
{
actionType: ACTION_TYPE.FLAG,
reason: GQLCOMMENT_FLAG_REASON.COMMENT_DETECTED_SUSPECT_WORD,
},
],
+ metadata: {
+ wordList: {
+ timedOut: true,
+ },
+ },
};
}
};
diff --git a/src/locales/en-US/admin.ftl b/src/locales/en-US/admin.ftl
index 96988e27a..cf29d1abb 100644
--- a/src/locales/en-US/admin.ftl
+++ b/src/locales/en-US/admin.ftl
@@ -849,7 +849,9 @@ moderate-navigation-comment-count = { SHORT_NUMBER($count) }
moderate-marker-preMod = Pre-mod
moderate-marker-link = Link
moderate-marker-bannedWord = Banned word
+moderate-marker-possibleBannedWord = Possible Banned Word
moderate-marker-suspectWord = Suspect word
+moderate-marker-possibleSuspectWord = Possible Suspect Word
moderate-marker-spam = Spam
moderate-marker-spamDetected = Spam detected
moderate-marker-toxic = Toxic