Skip to content

Add delay of spam_analysis queue#14304

Merged
andreslucena merged 4 commits intodevelopfrom
fix/ai-analysis-service
Mar 17, 2025
Merged

Add delay of spam_analysis queue#14304
andreslucena merged 4 commits intodevelopfrom
fix/ai-analysis-service

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

🎩 What? Why?

While trying to deploy the ai module to configure the spam detection system, we noticed that sometimes the detection system is not working properly. We have investigated the logs and noticed the following error:

2025-03-14T10:04:02.865Z pid=1 tid=51q9 class=Decidim::Ai::SpamDetection::GenericSpamAnalyzerJob jid=8f1518a627244d4f6caea3e9 INFO: start
E, [2025-03-14T10:04:02.869725 #1] ERROR -- : [ActiveJob] [Decidim::Ai::SpamDetection::GenericSpamAnalyzerJob] [a558e31d-7742-4503-9f7f-ad7d87462824] Discarded Decidim::Ai::SpamDetection::GenericSpamAnalyzerJob due to a ActiveJob::DeserializationError.
I, [2025-03-14T10:04:02.869818 #1]  INFO -- : [ActiveJob] [Decidim::Ai::SpamDetection::GenericSpamAnalyzerJob] [a558e31d-7742-4503-9f7f-ad7d87462824] Performed Decidim::Ai::SpamDetection::GenericSpamAnalyzerJob (Job ID: a558e31d-7742-4503-9f7f-ad7d87462824) from Sidekiq(spam_analysis) in 4.08ms
2025-03-14T10:04:02.870Z pid=1 tid=51q9 class=Decidim::Ai::SpamDetection::GenericSpamAnalyzerJob jid=8f1518a627244d4f6caea3e9 elapsed=0.005 INFO: done

From the logs we noticed that the jobs were discarded due to a due to a ActiveJob::DeserializationError. I have encountered this back in #7507, when we had some DeserializationError on the machine translation.

📌 Related Issues

Link your PR to an issue

Testing

  • Pipeline is green

♥️ Thank you!

@alecslupu alecslupu added the release: v0.30 Issues or PRs that need to be tackled for v0.30 label Mar 14, 2025
@github-actions github-actions bot added module: generators type: fix PRs that implement a fix for a bug module: ai labels Mar 14, 2025
github-actions[bot]
github-actions bot previously approved these changes Mar 14, 2025
github-actions[bot]
github-actions bot previously approved these changes Mar 14, 2025
@alecslupu alecslupu requested a review from a team March 14, 2025 11:43
@andreslucena andreslucena changed the title Add delay of spam_analysis queue Add delay of spam_analysis queue Mar 14, 2025
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we lower the delay to like 30 seconds? 5 minutes seem a bit too much

@alecslupu
Copy link
Copy Markdown
Contributor Author

Can't we lower the delay to like 30 seconds? 5 minutes seem a bit too much

5 minutes we have for translations as well. Also is a bit irrelevant, since we have the config initializer that would allow people to manually set their own intervals.

In my other contract, i noticed that most spam attacks are happening during the night.
Also, that action would trigger a scan, not the actual message moderation.

@alecslupu alecslupu requested a review from andreslucena March 14, 2025 15:56
@alecslupu
Copy link
Copy Markdown
Contributor Author

@andreslucena decreased the time to 30 seconds.

Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏🏽

@andreslucena andreslucena merged commit 773e096 into develop Mar 17, 2025
56 checks passed
@andreslucena andreslucena deleted the fix/ai-analysis-service branch March 17, 2025 10:03
@alecslupu alecslupu added the no-backport Pull Requests that should not be backported label Mar 18, 2025
@alecslupu
Copy link
Copy Markdown
Contributor Author

Add no-backport, as the feature does not exist in 0.29

entantoencuanto added a commit that referenced this pull request Mar 20, 2025
* feature/signature_workflows:
  Add documentation for signature handler encryption secret and rename environment variable
  Rename method
  Fix title on spec for the 'Create new proposal' page (#14347)
  Fix WCAG search filters navigation (#14014)
  Fix comment cell to not show reply button when passing MAX_DEPTH (#14291)
  Fix editing comment with max length setting (#14275)
  Add title tag on pages for blogs, debates and meetings (#14110)
  Fix white bottom on proposal show with voting (#14285)
  New Crowdin updates (#14318)
  New Crowdin updates (#14217)
  Fix image missing error (#14175)
  Add delay of `spam_analysis` queue (#14304)
  Fix hide comment from interface (#14301)
  Change "Valuator" for "Evaluator" (#13684)
  Fix QR code generation (#14300)
  Patch backporter action (#14292)
  Change `hide_voting` argument on proposal cell to `show_voting` (#14267)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: ai module: generators no-backport Pull Requests that should not be backported release: v0.30 Issues or PRs that need to be tackled for v0.30 type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants