Skip to content

fix: count genuinely claimable BenIDs, not just non-provisioned ones - #197

Open
vishwab1 wants to merge 1 commit into
release-3.9.0from
vb/3.9.0-bengen
Open

fix: count genuinely claimable BenIDs, not just non-provisioned ones#197
vishwab1 wants to merge 1 commit into
release-3.9.0from
vb/3.9.0-bengen

Conversation

@vishwab1

Copy link
Copy Markdown
Member

checkBenIDAvailabilityLocal() previously counted Provisioned=false rows only, which overstates what's actually available - it also counts rows claimed (Reserved=true) by an in-flight registration that was later abandoned or crashed before completing. Those rows are stuck (the claim query requires Reserved=false) and were never really available.

Adds countByProvisionedAndReserved and switches the check to exclude Reserved=true rows, so callers (including MMU-API's new BenID pool auto top-up scheduler) get an accurate count.

📋 Description

JIRA ID:

Please provide a summary of the change and the motivation behind it. Include relevant context and details.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

checkBenIDAvailabilityLocal() previously counted Provisioned=false rows
only, which overstates what's actually available - it also counts rows
claimed (Reserved=true) by an in-flight registration that was later
abandoned or crashed before completing. Those rows are stuck (the claim
query requires Reserved=false) and were never really available.

Adds countByProvisionedAndReserved and switches the check to exclude
Reserved=true rows, so callers (including MMU-API's new BenID pool
auto top-up scheduler) get an accurate count.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: be5e1eac-877b-49a7-99ee-590ffec7d6e5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@sonarqubecloud

Copy link
Copy Markdown

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