fix: resolve claim dividends' signing Identity from the Procedure's own Context - #1663
Merged
polymesh-bot merged 2 commits intoAug 27, 2026
Merged
Conversation
Open
2 tasks
F-OBrien
previously approved these changes
Aug 27, 2026
prepareClaimDividends called distribution.getParticipant() with no args, letting it default the identity to check off distribution.context - the Context the DividendDistribution entity happened to be fetched with. That Context is not necessarily this Procedure's own Context (context.clone() scoped to this call's signingAccount), so any consumer that fetches entities off a shared Context while overriding signingAccount per call (e.g. the REST API) had claim() silently check participation for whatever Identity that shared Context's signingAddress last pointed to, instead of the Identity actually signing the claim - failing with 'The signing Identity is not included in this Distribution' even for a genuine participant. Resolve the signing Identity from the Procedure's own Context explicitly and pass it into getParticipant() so the correct Identity is always the one checked.
prashantasdeveloper
force-pushed
the
fix/claim-dividends-wrong-context-identity
branch
from
August 27, 2026 09:06
a844b29 to
6f13f8b
Compare
F-OBrien
approved these changes
Aug 27, 2026
|
Contributor
Author
|
/fast-forward |
Collaborator
|
🎉 This PR is included in version 31.1.0-beta.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.



Summary
prepareClaimDividendscalleddistribution.getParticipant()with no arguments, letting it default the identity to check viadistribution.context.getSigningIdentity(). But theDividendDistributionentity carries whateverContextit happened to be fetched with, which is not necessarily the Procedure's own per-callContext(context.clone(), scoped to this call'ssigningAccount).Any consumer that fetches entities off one shared/long-lived
Contextwhile overridingsigningAccountper call — the polymesh-rest-api being the clearest example — hit this:claim()silently checked participation for whatever Identity the shared Context'ssigningAddresslast happened to point to, instead of the Identity actually signing the claim. The result was a deterministic'The signing Identity is not included in this Distribution'rejection for a genuine, funded participant.Root cause, confirmed live
Reproduced end-to-end against a real chain v8 node + polymesh-rest-api, with temporary debug instrumentation in the running REST API's SDK copy:
getParticipant()was resolving an entirely unrelated Identity (0 balance) via the stale shared Context, not the claimant. This also explains why a checkpoint-balance lookup and an equivalentpushBenefitpayment (which takes explicit DIDs, never defaulting via signing identity) were both unaffected.Fix
Resolve the signing Identity from the Procedure's own
contextexplicitly and pass it intogetParticipant({ identity }), so the Identity checked is always the one actually signing this call.Test plan
claimDividends,DividendDistribution,Checkpoint) pass unmodifiedtsc/eslintcleancorporate-actions/dividend-distributionssuite (restoring its previously-removed self-claim step) against a real chain v8 node — 13/13 passing, including the claim step