Clamp "Messages left to delete" so it never goes negative - #3147
Closed
biggdawg320 wants to merge 1 commit into
Closed
biggdawg320 wants to merge 1 commit into
biggdawg320 wants to merge 1 commit into
Conversation
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>
|
|
Contributor
|
Thanks for the contribution, we will not be merging this pull request as it will be fixed in ServiceControl via Particular/ServiceControl#5939 |
Contributor
|
This issue was found to only be visible in ServicePulse when using the upcoming SQL storage engines in ServiceControl. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
src/Frontend/src/components/failedmessages/messageGroupDeleteCounters.spec.ts) that fails on the current code and passes with this change.cd src/Frontend && npx vitest run ./src/stores ./src/components/failedmessagesThis change was drafted with AI assistance (Claude) and verified against the project's own test suite before submission.