fix(action-token): do not promise tokens a pending send reserved - #577
Merged
mahdi2ba merged 1 commit intoSep 21, 2026
Merged
Conversation
Share link generation took the first N tokens of the wallet, reserved or not, while every transfer path skips reserved ones. The link was issued with no warning and redeem refused it with a 409 that landed on the recipient, who could do nothing about it. Add Token.getAvailableTokens, filtering transfer_pending and claim, and page over that when picking a bundle. The existing count check then produces the 409 at generate time, where the sender can act on it. getByOwner is untouched, so GET /tokens still shows a wallet's full holdings. Apply the same rule to the explicit ids path, which checked ownership only. This is what Transfer.transferActionToken already enforces at claim time, moved earlier. Refs Greenstand#571
|
🎉 This PR is included in version 1.44.0-keycloak.29 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
6 tasks
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.
Problem
Share link generation took the first N tokens of the wallet, reserved or not, while every transfer path skips reserved ones. The link was issued with no warning, and redeem refused it with a 409 that landed on the recipient, who could do nothing about it.
Token.getByOwnerfilters onwallet_idonly, so_selectAvailableTokensexcluded tokens promised by other links but not tokens reserved by a pending send. The explicit ids path checked ownership and nothing else.Fix
Token.getAvailableTokensfilterstransfer_pendingandclaim, and the bundle path pages over that. The existing count check then produces the 409 at generate time, where the sender can act on it.getByOwneris untouched, soGET /tokensstill shows a wallet's full holdings.The explicit ids path now applies the same rule, which is what
Transfer.transferActionTokenalready enforces at claim time, moved earlier.Testing
New spec: 3 of 5 tokens reserved, a link for 3 is refused with 409, a link for 2 succeeds and names no reserved token. Both assertions fail without this change,
201instead of409and 3 promised tokens instead of 2.Unit 241 passing, integration 135 passing.
Refs #571