Repository navigation
Conversation
On the Internet Identity path, the transfer can land and the refresh can fail. The retry sends the same transaction, the ledger answers TxDuplicate, and the refresh never runs. The ICP stays on the neuron account and the stake does not count it. Treat a duplicate as a landed transfer, as the device path does.
|
✅ No security or compliance issues detected. Reviewed everything up to 0a916a6. Security OverviewDetected Code Changes
|
📊 Build Bundle StatsThe latest build generated the following assets: |
Contributor
There was a problem hiding this comment.
🟢 Approved
No active review issues remain for the change allowing duplicate Internet Identity transfers to trigger a neuron refresh.
No open issues 🎉
What changed in this PR
Fixes Internet Identity stake-increase retries so a duplicate ledger transfer still triggers a neuron refresh, allowing an already-landed transfer to count toward the stake.
Changes:
- Treats duplicate transfers as successful in the Internet Identity path, matching device-path behavior.
- Preserves failure handling for all other transfer errors without refreshing the neuron.
- Adds tests for duplicate retries, transaction timestamp reuse and reset, and rejected transfers.
| File | Description |
|---|---|
src/governance-app-frontend/src/features/stakes/hooks/useIncreaseStake.tsx |
Allows neuron refresh after a duplicate Internet Identity transfer. |
src/governance-app-frontend/src/features/stakes/hooks/useIncreaseStake.test.tsx |
Tests retry recovery, timestamp handling, and non-duplicate rejection behavior. |
Review effort: Balanced
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.
Motivation
On the Internet Identity path, the transfer can land and the refresh can fail.
createdAtRefkeeps its value, so a retry with the same amount sends the same transaction. The ledger answersTxDuplicate, the hook throws, and the refresh never runs. The ICP stays on the neuron account, the stake does not count it, and each retry shows an error.Changes
useIncreaseStake: a duplicate now counts as a landed transfer and the refresh runs, same as the device path.createdAtRefis lost and a new attempt is a second real transfer.