Skip to content

fix(batch-move): graceful attachment-fetch degradation + mid-loop client re-check - #1750

Merged
LucasSantana-Dev merged 5 commits into
mainfrom
fix/1563-batch-move-executor-hardening
Jul 10, 2026
Merged

LucasSantana-Dev merged 5 commits into
mainfrom
fix/1563-batch-move-executor-hardening

Conversation

@LucasSantana-Dev

@LucasSantana-Dev LucasSantana-Dev commented Jul 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Hardens batch channel-move executor with two robustness fixes:

  1. Graceful attachment-fetch degradation — wrap fetchAttachments in try-catch; post embed without files on transient CDN/rate-limit failures instead of failing the message move
  2. Mid-loop client re-check — re-validate Discord client connection between pages; pause the job if disconnected instead of burning through items as failures

Both are safe (per-message try-catch marks items failed, no data loss), just not optimal on current main.

Verification

  • typecheck: ✓ Pass
  • lint: ✓ No new errors on modified file

Closes #1563


Summary by cubic

Hardens the batch channel move executor to keep jobs running when attachment fetches fail and to pause safely on Discord client disconnects. Reduces noisy failures and aligns with Linear #1563.

  • Bug Fixes

    • Graceful attachment fetch: wrap retrieval in try/catch; send embeds without files on transient CDN/rate-limit errors.
    • Mid-loop client re-check: validate connection between pages and return paused if disconnected instead of burning through items.
  • Refactors

    • Tightened types to AttachmentBuilder[] for fetched files and removed an unused import.

Written for commit 7c8f51f. Summary will update on new commits.

Review in cubic

…ent re-check

- Wrap fetchAttachments in try-catch to degrade gracefully on transient CDN/rate-limit failures; post embed without files instead of failing the message move
- Re-validate Discord client connection mid-loop (after each page) and pause the job if disconnected instead of burning through items as failures

Closes #1563
@coderabbitai

coderabbitai Bot commented Jul 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 17 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 33fe9d0d-5b65-4732-a717-43988db390ef

📥 Commits

Reviewing files that changed from the base of the PR and between a59db7b and 7c8f51f.

📒 Files selected for processing (1)
  • packages/bot/src/functions/moderation/batch/channelMoveExecutor.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1563-batch-move-executor-hardening

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

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@github-actions

github-actions Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Warnings
⚠️

User-facing change without a CHANGELOG.md update. Add a line under ## [Unreleased] if this should appear in release notes. (Or apply the skip-changelog label if this PR does not affect end users.)

Generated by 🚫 dangerJS against 7c8f51f

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 1 file

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

Re-trigger cubic

Comment thread packages/bot/src/functions/moderation/batch/channelMoveExecutor.ts
Comment thread packages/bot/src/functions/moderation/batch/channelMoveExecutor.ts
@LucasSantana-Dev
LucasSantana-Dev enabled auto-merge (squash) July 9, 2026 18:57
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

@LucasSantana-Dev
LucasSantana-Dev merged commit f21a0ce into main Jul 10, 2026
43 checks passed
@LucasSantana-Dev
LucasSantana-Dev deleted the fix/1563-batch-move-executor-hardening branch July 10, 2026 00:10
LucasSantana-Dev added a commit that referenced this pull request Jul 10, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>2.34.0</summary>

##
[2.34.0](v2.33.1...v2.34.0)
(2026-07-10)


### Features

* **twitch:** use Promise.allSettled for per-event subscription error
logging ([#1749](#1749))
([6691305](6691305))


### Bug Fixes

* [#1699](#1699)
([eef5aee](eef5aee))
* **backend:** migrate webhooks to use canonical timingsafekey
comparison
([#1747](#1747))
([eef5aee](eef5aee))
* **backend:** wrap lastfm routes with asynchandler
([#1726](#1726))
([ce51d86](ce51d86))
* **batch-move:** graceful attachment-fetch degradation + mid-loop
client re-check
([#1750](#1750))
([f21a0ce](f21a0ce))
* **bot:** approve @discordjs/opus install script — P0 music playback
outage ([#1757](#1757))
([9d894e4](9d894e4))
* **ci:** add missing packages field to pnpm-workspace.yaml
([#1760](#1760))
([a4c585d](a4c585d))
* **ci:** remove pnpm shim from bundle-size workflow
([#1759](#1759))
([eaf676f](eaf676f))
* **deploy:** increase validation timeout to 10min
([#1743](#1743))
([07891ec](07891ec))
* **docker:** copy+chown [@prisma](https://github.com/prisma) engines in
production-backend — P0 deploy pipeline blocker
([#1758](#1758))
([a70d0e8](a70d0e8))
* eliminate mock state pollution in bot tests and remove resetMocks
config ([#1741](#1741))
([2e5fd94](2e5fd94))
* **frontend:** prevent state updates after unmount
([#1748](#1748))
([f4e7c45](f4e7c45))
* pin file-type to resolve CI flake
[#1740](#1740)
([#1753](#1753))
([6b8e527](6b8e527))
* reduce Jest maxWorkers and add DB pool config for test stability
([#1751](#1751))
([cfead33](cfead33))
* use fake timers in ReminderService.spec to prevent race condition
([#1745](#1745))
([ba2908c](ba2908c))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
This was referenced Oct 1, 2026
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.

batch-move executor: graceful attachment-fetch degradation + mid-loop client re-check

1 participant