Skip to content

Clamp "Messages left to delete" so it never goes negative - #3147

Closed
biggdawg320 wants to merge 1 commit into
Particular:masterfrom
biggdawg320:jobscout/3126-deleting-a-failed-group-may-overflow-the
Closed

biggdawg320 wants to merge 1 commit into
Particular:masterfrom
biggdawg320:jobscout/3126-deleting-a-failed-group-may-overflow-the

Conversation

@biggdawg320

Copy link
Copy Markdown

While a large group delete is running, ServiceControl computes "messages left" as the starting count minus the deleted count, each from a separate query. If new failures keep arriving in the group during the delete, the deleted count can overtake the starting count, and the frontend rendered that negative value directly. This change clamps the displayed remaining count to a minimum of zero in MessageGroupList.vue's delete-progress panel, so the counter no longer overflows below zero while a delete is in progress. Added a regression test that mounts the group list with a group mid-delete whose remaining count is negative and asserts the UI shows 0 instead.

Fixes #3126

Testing

  • Added a test (src/Frontend/src/components/failedmessages/messageGroupDeleteCounters.spec.ts) that fails on the current code and passes with this change.
  • The surrounding tests pass: cd src/Frontend && npx vitest run ./src/stores ./src/components/failedmessages

This change was drafted with AI assistance (Claude) and verified against the project's own test suite before submission.

ServiceControl derives the remaining count for a group delete as
starting count minus deleted count, using two separate queries. When
new failures keep arriving in the group while a large delete is in
progress, the deleted count can exceed the starting count, driving
the remaining count negative. The frontend rendered that raw value
as-is. Clamp it to zero in the template so the UI never shows a
negative "Messages left to delete" figure.

Co-Authored-By: Claude <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@rbev

rbev commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution, we will not be merging this pull request as it will be fixed in ServiceControl via Particular/ServiceControl#5939

@rbev rbev closed this Oct 1, 2026
@rbev

rbev commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This issue was found to only be visible in ServicePulse when using the upcoming SQL storage engines in ServiceControl.
It was not able to be replicated on the current RavenDB storage engine.

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.

Deleting a failed group may overflow the counters

3 participants