WIP: Fixed stale pending acceptances on checkin and transfer, and reconcile accessory quantities - #19555
Draft
marcusmoore wants to merge 18 commits into
Draft
Conversation
marcusmoore
marked this pull request as draft
August 26, 2026 00:54
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Complexity | 2 medium |
🟢 Metrics 62 complexity
Metric Results Complexity 62
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
Currently, an unanswered acceptance request could outlive the checkout it belonged to and the user will continue to see it on
/account/accept.Scenarios where this occurs
Mostly shared setup
/admin/slack: leave the webhook endpoint empty.Scenario 1. Checkin never clears the acceptance when notifications are off
/account/acceptlists the request. Leave it unanswered./account/accept: the request is still there, and still signable.The same steps will show the same issue for a license whose category has the settings from above.
Scenario 2. Transferring a license seat never cleared the source user's acceptance
Scenario 3. Checking in one unit of a multi-unit accessory clears the whole acceptance
/account/acceptshows one request with a quantity of 3. Leave it unanswered.In this PR: the request remains with a quantity of 2.
Scenario 4. Checking in one item clears a same-id item's acceptance
/account/accept) but do not respond.The same collison happens for license seat ids.
The Fix
Snapshot the pending rows from the
checkout_acceptancestable:2026_08_24_234955_clean_stale_pending_acceptancesdevelopmigrateqty 3qty 2What changed
The core issue is that the
CheckoutableListenercould exit before doing any checkout acceptance clean up depending on notification settings. This PR ensures that clean up logic runs.For accessories: a checkin retires one unit from the oldest pending row (via decrement or deletion if the qty is 1) rather than a row that may be worth three.
AI Disclosure: I used Claude to help investigate the underlying issues as well as write a lot of the code. I went through and cleaned stuff up.