From ea1aca3f1ed728a2c95dd8d9977845cb6793e516 Mon Sep 17 00:00:00 2001 From: Foysal Ahamed Date: Sat, 16 Nov 2024 18:54:30 +0100 Subject: [PATCH 1/3] :bug: Fix typo in moderation review state check --- automod/engine/fetch_account_meta.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automod/engine/fetch_account_meta.go b/automod/engine/fetch_account_meta.go index 5c55b417f..7be937366 100644 --- a/automod/engine/fetch_account_meta.go +++ b/automod/engine/fetch_account_meta.go @@ -145,7 +145,7 @@ func (e *Engine) GetAccountMeta(ctx context.Context, ident *identity.Identity) ( ap.ReviewState = ReviewStateEscalated case "#reviewClosed": ap.ReviewState = ReviewStateClosed - case "#reviewNonde": + case "#reviewNone": ap.ReviewState = ReviewStateNone } } From d7fd302e415156d811bbab73b7011631d30a98bf Mon Sep 17 00:00:00 2001 From: Foysal Ahamed Date: Sat, 16 Nov 2024 19:11:11 +0100 Subject: [PATCH 2/3] :bug: Use actual value of review state --- automod/engine/fetch_account_meta.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/automod/engine/fetch_account_meta.go b/automod/engine/fetch_account_meta.go index 7be937366..b3cf7684d 100644 --- a/automod/engine/fetch_account_meta.go +++ b/automod/engine/fetch_account_meta.go @@ -139,13 +139,13 @@ func (e *Engine) GetAccountMeta(ctx context.Context, ident *identity.Identity) ( ap.AccountTags = dedupeStrings(rd.Moderation.SubjectStatus.Tags) if rd.Moderation.SubjectStatus.ReviewState != nil { switch *rd.Moderation.SubjectStatus.ReviewState { - case "#reviewOpen": + case "tools.ozone.moderation.defs#reviewOpen": ap.ReviewState = ReviewStateOpen - case "#reviewEscalated": + case "tools.ozone.moderation.defs#reviewEscalated": ap.ReviewState = ReviewStateEscalated - case "#reviewClosed": + case "tools.ozone.moderation.defs#reviewClosed": ap.ReviewState = ReviewStateClosed - case "#reviewNone": + case "tools.ozone.moderation.defs#reviewNone": ap.ReviewState = ReviewStateNone } } From e0efa19ff7f096bd76737939c8894afa3ecd6ac6 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Wed, 4 Dec 2024 10:54:34 -0800 Subject: [PATCH 3/3] add warn log line for unexpected review state --- automod/engine/fetch_account_meta.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/automod/engine/fetch_account_meta.go b/automod/engine/fetch_account_meta.go index b3cf7684d..39b4df1eb 100644 --- a/automod/engine/fetch_account_meta.go +++ b/automod/engine/fetch_account_meta.go @@ -147,6 +147,8 @@ func (e *Engine) GetAccountMeta(ctx context.Context, ident *identity.Identity) ( ap.ReviewState = ReviewStateClosed case "tools.ozone.moderation.defs#reviewNone": ap.ReviewState = ReviewStateNone + default: + logger.Warn("unexpected ozone moderation review state", "state", rd.Moderation.SubjectStatus.ReviewState, "did", ident.DID) } } }