Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CORL-3136] Fix Akismet spam/not-spam comment submissions #4604

Merged
merged 1 commit into from
May 6, 2024

Conversation

nick-funk
Copy link
Contributor

@nick-funk nick-funk commented Apr 26, 2024

What does this PR do?

Update approve/reject spam submission to use FLAG__COMMENT_... for retrieving action count status instead of COMMENT_....

When we access the raw actionCounts record, we have to use the serialized values or else they will come back as undefined.

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

None

Does this PR introduce any new environment variables or feature flags?

No

If any indexes were added, were they added to INDEXES.md?

N/A

How do I test this PR?

  • run Coral in a dev mode so you can attach with a debugger
    • add a break point to server/src/core/server/stacks/approveComment.ts on line 70
      • on the submitCommentAsNotSpam call
    • add a break point to server/src/core/server/stacks/rejectComment.ts on line 132
      • on the submitCommentAsSpam call
  • enable Akismet spam detection (both radio buttons on)
    • use an akismet key from one of the dev instances
  • make a commenter user
  • with that user, post a long comment
  • edit the comment and paste in a link at the bottom of the comment
    • I used a random music video from YouTube as a URL
  • see that the comment is submitted for moderation
  • in the admin, see that the comment has been detected as spam
    • in the details for the marker
  • approve/reject and see that the debug breakpoints you placed are hit
    • this confirms we are submitting corrections to Akismet
    • if you want to check the Akismet submission results, you can hop into those functions and debug out the results from the AkismetClient submission
      • spoiler: it's a boring and simple boolean true/false value

Were any tests migrated to React Testing Library?

No

How do we deploy this PR?

Merge into develop and then release develop into main as usual.

when we access the raw actionCounts record, we have to
use the serialized values or else they will come back as
undefined.
@nick-funk nick-funk requested a review from kabeaty April 26, 2024 16:23
Copy link

netlify bot commented Apr 26, 2024

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit f5921c4
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/662bd4fe87e5000008043047

Copy link
Contributor

@kabeaty kabeaty left a comment

Choose a reason for hiding this comment

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

Oof. Good catch and fix here!

@tessalt tessalt added this pull request to the merge queue May 6, 2024
@tessalt tessalt added this to the v9.0.5 milestone May 6, 2024
Merged via the queue into develop with commit 2aa6d42 May 6, 2024
6 checks passed
@tessalt tessalt deleted the fix/CORL-3136-fix-akismet-not-spam-submission branch May 6, 2024 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants