Skip to content

🐛 fix(nps-relay): release the per-IP registration slot when the day cap refuses a registration - #558

Merged
hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-557
Nov 1, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
mainfrom
scanner/fix-557

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Mirror of #555's handleSubmit fix for handleRegister. The per-IP slot is reserved before the global day counter is checked; when the day cap refused, the 429 left the slot consumed. Each IP only gets 3 registrations per window (24h), so a day-cap refusal burned one of them for 24h, outlasting the day roll-over that would have let the registration succeed. The slot is now released on refusal.

Closes #557

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

… refuses a registration

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs canceled.

Name Link
🔨 Latest commit 0a54f60
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ae6ec3af9b516b8a2afc65d

@hivecommons-hive

hivecommons-hive Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

Evidence bundle `#5580a54f60` sha256:162b6e987b529e12f2d7e7774d0d3acb7d826675057c513cf2ffeec85c95bce1 — download from the dashboard or `hivectl review evidence #558`.

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Read handleRegister and handleSubmit on the PR head (0a54f60) and ran the suite. This looks correct to me.

  • relay.ts:749-769 now mirrors the submit path exactly: handleSubmit already does reserveSlot(ip) → reserveSlot(install) → releaseSlot(ip) on refusal (relay.ts:863-874), and releaseSlot (relay.ts:575-586) removes the now timestamp this same call reserved, so the release cannot drop another request's slot.
  • The CAS loop in compareAndSwap (relay.ts:538-553) means the release is safe under concurrent registrations from the same IP.
  • Test: netlify/nps-relay/relay.test.ts:493-505 fails on origin/main with expected [ 1790683200000 ] to deeply equal [] and passes with the fix; full file 49/49 green.

Matches #557's scope with no extra changes; changelog fragment follows the fixed-<n>-… naming. Nothing blocking from my side.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit 1c53b64 into main Nov 1, 2026
10 of 11 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-557 branch November 1, 2026 07:48
@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026
hivecommons-hive Bot added a commit that referenced this pull request Nov 1, 2026
…ubmit request (#564)

Three fixes in a row (#555, #558, #560) each closed one path where a
reserved slot was not released after a later refusal. Each shipped a
site-local regression test; nothing asserted the class. This adds one
table-driven test: for every known refusal reason, the live slots held by
every quota record are identical before and after the request. Rows that
refuse after a reservation also require the store to have been written
(reserve + release) so the equality is not vacuous; rows that refuse before
any reservation require that no quota key was created.

Reverting any one of the three release hunks makes exactly one row fail.

Closes #563

Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] nps-relay: day-cap rejection in handleRegister leaves the per-IP registration slot consumed

0 participants