Skip to content

add slack reaction based moderation alerts - #5034

Merged
kasya merged 11 commits into
OWASP:mainfrom
Mr-Rahul-Paul:fix-4577
Aug 17, 2026
Merged

add slack reaction based moderation alerts#5034
kasya merged 11 commits into
OWASP:mainfrom
Mr-Rahul-Paul:fix-4577

Conversation

@Mr-Rahul-Paul

@Mr-Rahul-Paul Mr-Rahul-Paul commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Proposed Change

Resolves #4577.

This PR adds a Phase 1 implementation for Slack reaction-based content reporting in NestBot.

When a configured reaction reaches its threshold on a Slack message, NestBot records the alert and posts one notification to a configured moderation channel. This phase is notification-only and does not delete, hide, warn, or DM users.

NestBot moderation reaction flow

What Changed

  • Added ModerationRule for admin-managed reaction rules and thresholds.
  • Added ModerationAlert to record sent alerts and prevent duplicates.
  • Added a reaction_added Slack event handler.
  • Added required Slack manifest entries:
    • reactions:read
    • reaction_added
  • Added local ngrok origin support for Slack callback testing.

Setup Notes

For local testing, use a development Slack workspace and a local ngrok tunnel.

  • Slack needs a public HTTPS callback URL, so ngrok is required for local testing. Start ngrok, copy
    the Forwarding URL, and use that URL in the Slack app manifest for the Slack callback URLs.

  • Moderation rules are configured in Django admin.

    • replace the links of owasp.org... to the ngrok link in https://app.slack.com/app-settings/.../.../app-manifest
    • get the slack tokens from https://api.slack.com/apps/.../install-on-team
    • paste the Forwarding ngrok link in backend/.env

Required local values include:

DJANGO_SLACK_BOT_TOKEN=...
DJANGO_SLACK_SIGNING_SECRET=...
SLACK_BOT_TOKEN_<WORKSPACE_ID>=`SAME TOKEN AS DJANGO_SLACK_BOT_TOKEN`
DJANGO_LOCAL_NGROK_ORIGIN=https://<ngrok-domain>

SLACK_BOT_TOKEN_<WORKSPACE_ID> (which is same as DJANGO_SLACK_BOT_TOKEN) is needed when running the existing slack_sync_data command to create Conversation rows. For a single development workspace, it can reuse the same token value as DJANGO_SLACK_BOT_TOKEN.

After updating the Slack manifest, the app must be reinstalled so the new event and scope are active.

Notes

  • Slack emoji aliases are not normalized yet.
  • NestBot must be added to both the source channel and the moderation alert channel.
  • Local ngrok URLs should not be committed to the manifest.

todo

Add unit tests for reaction handling and duplicate-alert behavior. done.
Improve validation for moderation rule fields. done.
move the logic in a seperate service done.

Checklist

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds Slack reaction-based moderation support with new rule and alert models, a reaction_added processing service, Slack app wiring, a moderation sync command, local ngrok origin settings, and matching tests and configuration updates.

Changes

Slack Moderation Rollout

Layer / File(s) Summary
Moderation models, migration, and admin
backend/apps/slack/models/moderation.py, backend/apps/slack/models/__init__.py, backend/apps/slack/migrations/0023_moderationalert_moderationrule.py, backend/apps/slack/admin/moderation.py, backend/apps/slack/admin/__init__.py, backend/tests/unit/apps/slack/admin/moderation_test.py, backend/tests/unit/apps/slack/models/moderation_test.py
Defines ModerationRule and ModerationAlert, creates their tables, exports them from the package, and registers admin screens with list/search/filter settings and read-only alert fields.
Reaction processing service
backend/apps/slack/services/moderation.py, backend/apps/slack/events/reaction_added.py, backend/tests/unit/apps/slack/events/reaction_added_test.py, backend/tests/unit/apps/slack/services/moderation_test.py
Implements process_reaction_added for payload parsing, rule lookup, reaction counting, alert creation, permalink lookup, posting, persistence, and rollback paths; ReactionAdded delegates to it, and tests cover the main flow plus failure cases.
Slack manifest and event wiring
backend/apps/slack/MANIFEST.yaml, backend/apps/slack/events/__init__.py, backend/apps/slack/events/url_verification.py, backend/tests/unit/apps/slack/events/url_verification_test.py
Adds the Slack reactions:read scope and reaction_added subscription, wires the event handler into startup, and switches URL verification to ack() handling with updated tests.
Moderation rule sync command and runtime wiring
backend/apps/slack/management/commands/slack_sync_moderation_rules.py, backend/apps/slack/Makefile, backend/apps/slack/config/moderation_rules.example.yaml, backend/apps/slack/config/moderation_rules.yaml, backend/tests/unit/apps/slack/commands/slack_sync_moderation_rules_test.py, docker-compose/local/compose.yaml
Adds the YAML-backed sync command, validation, make target, example/default rule files, command tests, and container startup invocation of the sync step.
Local origin settings and env example
backend/settings/local.py, backend/.env.example
Adds optional ngrok origin support to local allowed origins and documents the new environment placeholders.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Suggested labels

backend, backend-tests

Suggested reviewers

  • arkid15r
  • kasya
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: Slack reaction-based moderation alerts.
Description check ✅ Passed The description is directly aligned with the PR and explains the moderation-alert workflow and setup.
Linked Issues check ✅ Passed The changes implement emoji-based reporting, per-channel rules, thresholded notifications, and duplicate-alert prevention for #4577.
Out of Scope Changes check ✅ Passed No clearly unrelated changes stand out; the manifest, admin, config, tests, and deployment updates all support the moderation feature.
Docstring Coverage ✅ Passed Docstring coverage is 97.67% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
backend/apps/slack/admin/moderation.py (1)

21-34: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

ModerationAlertAdmin should mark nest_created_at as readonly to preserve audit integrity.

The nest_created_at field is displayed in list_display (line 30) but omitted from readonly_fields (line 33), allowing manual editing in the admin interface. Since alerts are audit records documenting when moderation thresholds were met, the creation timestamp should be immutable to prevent accidental or intentional tampering with the audit trail.

🔒 Proposed fix to protect the audit timestamp
     readonly_fields = (
         "conversation",
         "message_ts",
         "report_type",
         "reaction_count",
+        "nest_created_at",
     )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/apps/slack/admin/moderation.py` around lines 21 - 34, The
`nest_created_at` field is displayed in the `list_display` tuple of the
`ModerationAlertAdmin` class but is missing from the `readonly_fields` tuple,
allowing it to be edited in the admin interface. To preserve audit integrity and
prevent tampering with the creation timestamp, add `nest_created_at` to the
`readonly_fields` tuple alongside the other immutable fields such as
"conversation", "message_ts", "report_type", and "reaction_count".
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@backend/.env.example`:
- Line 16: The DJANGO_LOCAL_NGROK_ORIGIN environment variable in the
.env.example file lacks documentation about its required format. Add an inline
comment or hint next to the DJANGO_LOCAL_NGROK_ORIGIN setting to clarify that it
must include a URL scheme (e.g., https://abc123.ngrok-free.app), since this
value flows into Django's CSRF_TRUSTED_ORIGINS which requires a scheme. Without
this hint, users may provide only the hostname and encounter silent CSRF/CORS
check failures during setup.

In `@backend/apps/slack/events/reaction_added.py`:
- Around line 47-54: Wrap the client.reactions_get call in a try-except block to
handle potential Slack API failures gracefully. Catch SlackApiError exceptions
that may be raised from the reactions_get method call and log the error
appropriately before returning early from the function. This will prevent
unhandled exceptions from crashing the event handler when the Slack API call
fails.
- Around line 59-89: The ModerationAlert.objects.create() call is happening
before the Slack API calls (chat_getPermalink and chat_postMessage), which means
if either API call fails, an orphaned database record will be created and block
future retries due to the unique constraint. Move the
ModerationAlert.objects.create() call to after both chat_getPermalink() and
chat_postMessage() complete successfully, then immediately set the
alert_message_ts from the response and save it. This ensures the database record
is only persisted when all operations succeed, allowing proper retry behavior on
API failures.

---

Outside diff comments:
In `@backend/apps/slack/admin/moderation.py`:
- Around line 21-34: The `nest_created_at` field is displayed in the
`list_display` tuple of the `ModerationAlertAdmin` class but is missing from the
`readonly_fields` tuple, allowing it to be edited in the admin interface. To
preserve audit integrity and prevent tampering with the creation timestamp, add
`nest_created_at` to the `readonly_fields` tuple alongside the other immutable
fields such as "conversation", "message_ts", "report_type", and
"reaction_count".
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 744b958f-d0e5-4ebe-bddc-95f92dfb67a8

📥 Commits

Reviewing files that changed from the base of the PR and between ece391b and 236159c.

📒 Files selected for processing (11)
  • backend/.env.example
  • backend/apps/slack/MANIFEST.yaml
  • backend/apps/slack/admin/__init__.py
  • backend/apps/slack/admin/moderation.py
  • backend/apps/slack/events/__init__.py
  • backend/apps/slack/events/reaction_added.py
  • backend/apps/slack/events/url_verification.py
  • backend/apps/slack/migrations/0023_moderationalert_moderationrule.py
  • backend/apps/slack/models/__init__.py
  • backend/apps/slack/models/moderation.py
  • backend/settings/local.py

Comment thread backend/.env.example Outdated
Comment thread backend/apps/slack/events/reaction_added.py Outdated
Comment thread backend/apps/slack/events/reaction_added.py Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

5 issues found across 11 files

Confidence score: 2/5

  • In backend/apps/slack/events/reaction_added.py, the dedupe record is written before the Slack send, so transient Slack/API failures can mark an alert as already processed and permanently suppress future notifications for that event — make the dedupe write atomic with a successful send (or roll it back on send failure) before merging.
  • In backend/apps/slack/admin/moderation.py, ModerationAlertAdmin still allows add/delete despite the “readonly-ish records” intent, which can lead to accidental duplicate records or loss of moderation history and notification integrity — disable add/delete for this admin model before merge.
  • In backend/apps/slack/admin/moderation.py, alert_message_ts being editable while other tracking fields are readonly can let admins accidentally alter message linkage and make alert tracing unreliable — add alert_message_ts to readonly_fields to keep record immutability consistent.
  • In backend/apps/slack/events/url_verification.py, UrlVerification.handler() bypasses handle_event(), leaving that method unreachable in production dispatch and increasing maintenance/regression risk if logic is updated in the wrong place — either route through handle_event() or remove the dead method to align behavior and intent.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread backend/apps/slack/events/reaction_added.py Outdated
Comment thread backend/apps/slack/admin/moderation.py Outdated
Comment thread backend/apps/slack/admin/moderation.py Outdated
Comment thread backend/src/apps/slack/events/url_verification.py
Comment thread backend/.env.example Outdated
@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.03524% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.80%. Comparing base (3fab5b4) to head (7e8146a).

Files with missing lines Patch % Lines
backend/src/apps/slack/models/reaction_rule.py 88.67% 3 Missing and 3 partials ⚠️
backend/src/apps/slack/utils/reaction.py 95.00% 1 Missing and 1 partial ⚠️
backend/src/apps/slack/events/reaction_added.py 98.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5034      +/-   ##
==========================================
- Coverage   98.83%   98.80%   -0.04%     
==========================================
  Files         538      544       +6     
  Lines       17129    17354     +225     
  Branches     2460     2496      +36     
==========================================
+ Hits        16930    17146     +216     
- Misses         99      103       +4     
- Partials      100      105       +5     
Flag Coverage Δ
backend 99.31% <96.03%> (-0.06%) ⬇️
frontend 97.32% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
backend/src/apps/slack/admin/reaction_alert.py 100.00% <100.00%> (ø)
backend/src/apps/slack/admin/reaction_rule.py 100.00% <100.00%> (ø)
backend/src/apps/slack/events/url_verification.py 100.00% <100.00%> (ø)
backend/src/apps/slack/models/reaction_alert.py 100.00% <100.00%> (ø)
backend/src/apps/slack/events/reaction_added.py 98.33% <98.33%> (ø)
backend/src/apps/slack/utils/reaction.py 95.00% <95.00%> (ø)
backend/src/apps/slack/models/reaction_rule.py 88.67% <88.67%> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3fab5b4...7e8146a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Mr-Rahul-Paul

Copy link
Copy Markdown
Collaborator Author

i have split the original handle_event flow into small helper methods. To handle the api failures (as pointed by code rabbit) The behavior is the same, but the alert row is now created only after the notification succeeds.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@backend/apps/slack/events/reaction_added.py`:
- Around line 40-60: The alert deduplication check happens before posting to
Slack, which creates a race condition where multiple concurrent workers can pass
the _alert_exists check and each post duplicate alerts before the _create_alert
call writes to the database. Refactor the code to use an atomic get_or_create
operation before calling _post_alert, rather than checking _alert_exists upfront
and creating later. Replace the _alert_exists check at the beginning with a
get_or_create call that atomically creates the alert record if it doesn't exist,
then only proceed to get permalink and post alert if the record was newly
created, and finally update the alert record with the alert_message_ts returned
from _post_alert after successful posting instead of at the end with
_create_alert.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 95c028a6-876f-47dc-a5f8-0d0ed36420dc

📥 Commits

Reviewing files that changed from the base of the PR and between 236159c and 1bdbf05.

📒 Files selected for processing (2)
  • backend/.env.example
  • backend/apps/slack/events/reaction_added.py

Comment thread backend/apps/slack/events/reaction_added.py Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Requires human review: Auto-approval blocked by 3 unresolved issues from previous reviews.

Re-trigger cubic

@Mr-Rahul-Paul
Mr-Rahul-Paul marked this pull request as draft June 23, 2026 22:44
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread backend/apps/slack/events/reaction_added.py Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 2 files (changes from recent commits).

Requires human review: Auto-approval blocked by 1 unresolved issue from previous reviews.

Re-trigger cubic

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

2 issues found across 5 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread backend/tests/unit/apps/slack/events/reaction_added_test.py
Comment thread backend/tests/unit/apps/slack/events/reaction_added_test.py Outdated
@Mr-Rahul-Paul
Mr-Rahul-Paul marked this pull request as ready for review June 23, 2026 23:15
@Mr-Rahul-Paul
Mr-Rahul-Paul marked this pull request as draft June 23, 2026 23:15
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 23, 2026
cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Jun 23, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Re-trigger cubic

@Mr-Rahul-Paul
Mr-Rahul-Paul marked this pull request as ready for review June 23, 2026 23:29
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Contribution validation failed:

1 similar comment
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Contribution validation failed:

Signed-off-by: Mr-Rahul-Paul <179798584+Mr-Rahul-Paul@users.noreply.github.com>
Signed-off-by: Mr-Rahul-Paul <179798584+Mr-Rahul-Paul@users.noreply.github.com>
Signed-off-by: Mr-Rahul-Paul <179798584+Mr-Rahul-Paul@users.noreply.github.com>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 6, 2026
Comment thread infrastructure/modules/ecr-cache/.terraform.lock.hcl
Signed-off-by: Mr-Rahul-Paul <179798584+Mr-Rahul-Paul@users.noreply.github.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 19, 2026
Signed-off-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 19 files (changes from recent commits).

Confidence score: 3/5

  • In backend/src/apps/slack/models/reaction_alert.py, the lock around chat_postMessage can expire before record() completes, allowing a second handler to post a duplicate alert and then have its lock deleted by the first handler; this creates concrete duplicate-notification risk under slow Slack API calls—switch to an ownership-aware lock (token + compare-and-delete) and ensure lock TTL/renewal covers the full post-and-record critical section.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="backend/src/apps/slack/models/reaction_alert.py">

<violation number="1" location="backend/src/apps/slack/models/reaction_alert.py:9">
P1: If `chat_postMessage` runs longer than 30 seconds, another event can acquire this key and post a duplicate before the first `record()` runs. The first handler then deletes the successor’s lock unconditionally. Use an owner token with compare-and-delete and renew or hold the lease for the complete post.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread backend/src/apps/slack/events/reaction_added.py Outdated
from apps.common.models import TimestampedModel
from apps.slack.models.conversation import Conversation

LOCK_TTL_SECONDS = 30

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1: If chat_postMessage runs longer than 30 seconds, another event can acquire this key and post a duplicate before the first record() runs. The first handler then deletes the successor’s lock unconditionally. Use an owner token with compare-and-delete and renew or hold the lease for the complete post.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/src/apps/slack/models/reaction_alert.py, line 9:

<comment>If `chat_postMessage` runs longer than 30 seconds, another event can acquire this key and post a duplicate before the first `record()` runs. The first handler then deletes the successor’s lock unconditionally. Use an owner token with compare-and-delete and renew or hold the lease for the complete post.</comment>

<file context>
@@ -1,10 +1,13 @@
 from apps.common.models import TimestampedModel
 from apps.slack.models.conversation import Conversation
 
+LOCK_TTL_SECONDS = 30
+
 
</file context>

Comment thread backend/src/apps/slack/utils/reaction.py Outdated
Comment thread backend/src/apps/slack/models/reaction_alert.py
Signed-off-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 existing issue remains and no new issues found across 12 files (changes from recent commits).

Confidence score: 2/5

  • In backend/src/apps/slack/models/reaction_alert.py, the lock-release flow has a race where an expiring 120s lock can be re-acquired by another worker between cache.get and cache.delete, and the finishing worker may then delete the new owner’s lock, leading to duplicate reaction-alert processing and noisy/incorrect Slack alerts — make lock release owner-safe (e.g., token-checked atomic compare-and-delete or a Lua script) before relying on this for deduplication.

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread backend/src/apps/slack/migrations/0028_reactionrule_emojis.py
Comment thread backend/src/apps/slack/admin/reaction_rule.py
Comment thread backend/src/apps/slack/events/reaction_added.py Outdated
Comment thread backend/src/apps/slack/events/reaction_added.py
Signed-off-by: Arkadii Yakovets <2201626+arkid15r@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 8 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.

Re-trigger cubic

@kasya
kasya added this pull request to the merge queue Aug 17, 2026
Merged via the queue into OWASP:main with commit 073e4c8 Aug 17, 2026
36 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NestBot Content Reporting & Moderation Workflow

4 participants