Skip to content

fix(ban-all): report progress on job failure#112

Merged
lorenzocorallo merged 9 commits intomainfrom
ban-all-progress-report
Apr 13, 2026
Merged

fix(ban-all): report progress on job failure#112
lorenzocorallo merged 9 commits intomainfrom
ban-all-progress-report

Conversation

@toto04
Copy link
Copy Markdown
Contributor

@toto04 toto04 commented Apr 13, 2026

No description provided.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 13, 2026

Warning

Rate limit exceeded

@lorenzocorallo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 37 minutes and 50 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 37 minutes and 50 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 63e0d5fe-be3e-4900-ab84-254ccf3a334c

📥 Commits

Reviewing files that changed from the base of the PR and between b65cf95 and 9ba9250.

📒 Files selected for processing (1)
  • src/modules/moderation/ban-all.ts

Walkthrough

Extracted child-job completion handling into a shared reportProgress used for both "completed" and "failed" executor events; parent progress is recomputed and debug-logged, and Telegram progress update errors now log the caught error object.

Changes

Cohort / File(s) Summary
Ban Queue Progress Reporting
src/modules/moderation/ban-all.ts
Reworked executor event handling: moved inline "completed" handler into a shared reportProgress(job: BanJob) used for both "completed" and "failed" events, recompute parent progress from dependencies, emit debug log with parentId and dependency counts, and log caught error when Telegram progress update fails.

Sequence Diagram(s)

sequenceDiagram
  participant Executor as Executor
  participant Queue as BanAllQueue
  participant Store as JobStore
  participant Telegram as TelegramService

  Executor->>Queue: emit "completed" / "failed" (child job)
  Queue->>Store: load parent job & dependencies
  Queue->>Store: recompute parent progress from dependency counts
  Queue->>Queue: reportProgress(parentJob)  --(debug log: parentId + counts)
  Queue->>Telegram: throttle and send progress update
  Telegram-->>Queue: success / throws error
  alt Telegram error
    Queue->>Queue: log warning with caught error object
  end
Loading

Possibly related PRs

  • fix: log audit for banall #98: Edits the same src/modules/moderation/ban-all.ts area (initiateBanAll/executor handling), likely overlapping changes to progress reporting and logging.
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: handling progress reporting when jobs fail, which is the core refactoring described in the summary.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@src/modules/moderation/ban-all.ts`:
- Around line 244-247: The event listeners on this.executor for "completed" and
"failed" call the async reportProgress without handling Promise rejections; wrap
those calls to ensure rejections are caught (e.g., call
reportProgress(job).catch(err => /* log or handle error */) or use an async IIFE
with try/catch) so any Redis/BullMQ failures do not create unhandled promise
rejections; update the handlers for the "completed" and "failed" events where
reportProgress is invoked to catch and log errors.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 11de71a8-d4ad-4118-b1f2-b5bf68433ad5

📥 Commits

Reviewing files that changed from the base of the PR and between af05b84 and 5fcb706.

📒 Files selected for processing (1)
  • src/modules/moderation/ban-all.ts

Comment thread src/modules/moderation/ban-all.ts
@lorenzocorallo lorenzocorallo enabled auto-merge (squash) April 13, 2026 17:06
@lorenzocorallo lorenzocorallo merged commit c6f6274 into main Apr 13, 2026
2 checks passed
@lorenzocorallo lorenzocorallo deleted the ban-all-progress-report branch April 13, 2026 17:13
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.

2 participants