Skip to content

Prevent scavenger from re-enqueuing items already being picked up#541

Open
Reetus wants to merge 1 commit into
masterfrom
scavenger-debounce
Open

Prevent scavenger from re-enqueuing items already being picked up#541
Reetus wants to merge 1 commit into
masterfrom
scavenger-debounce

Conversation

@Reetus
Copy link
Copy Markdown
Owner

@Reetus Reetus commented Apr 6, 2026

Tracks pending item serials to skip items already in the action queue. Serials are removed via ContinueWith when the drag/drop action completes (success or failure), allowing retry on next CheckArea pass.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where the scavenger feature could enqueue duplicate drag and drop actions for the same item whilst a previous action was still processing.

Tracks pending item serials to skip items already in the action queue.
Serials are removed via ContinueWith when the drag/drop action completes
(success or failure), allowing retry on next CheckArea pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 16cf0715-1dc8-452a-9fd5-56b3d8539b96

📥 Commits

Reviewing files that changed from the base of the PR and between 3e09f07 and 7c4e243.

📒 Files selected for processing (1)
  • ClassicAssist/UI/ViewModels/Agents/ScavengerTabViewModel.cs

Walkthrough

Added a concurrency-tracking mechanism using _pendingSerials and _pendingSerialsLock to prevent duplicate drag/drop actions for the same item serial. The CheckArea() method now prunes non-existent items, skips pending serials, records enqueued serials, and removes them upon task completion via ContinueWith.

Changes

Cohort / File(s) Summary
Scavenger concurrency control
ClassicAssist/UI/ViewModels/Agents/ScavengerTabViewModel.cs
Added thread-safe tracking of pending item serials with lock-based synchronisation. Modified CheckArea() to prune stale entries, skip duplicate actions, and clean up serials after EnqueueDragDrop() completes. Prevents concurrent duplicate drag/drop operations for the same item.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and clearly summarizes the main change: preventing the scavenger from re-enqueueing items that are already being picked up, which aligns perfectly with the concurrency-tracking mechanism introduced.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scavenger-debounce

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.

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.

1 participant