Repository navigation
Conversation
…ead of blanking them
translateAdjustments pre-sized its result with len(from) and then skipped
SCHEDULED_FOR_PROCESSING adjustments with continue, which left a
zero-valued entry in their slot. GET /v2/transfer-initiations/{id} on any
scheduled transfer returned an adjustment with an empty adjustmentID, a
0001-01-01 createdAt and an empty status, which the generated v2 SDK
rejects (invalid value for TransferInitiationStatus).
Build the slice with append so dropped adjustments are really dropped.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
NumaryBot
approved these changes
Oct 1, 2026
NumaryBot
left a comment
Contributor
There was a problem hiding this comment.
The required automated review completed with no remaining findings.
This branch has not been deployed
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
GET /v2/transfer-initiations/{id}returns a blank entry inrelatedAdjustmentsfor every scheduled transfer or payout.translateAdjustmentssizes its result withmake(..., len(from))and assignsto[i]. WhentranslateStatusdrops aSCHEDULED_FOR_PROCESSINGadjustment, thecontinueleaves indexiat its zero value, so the entry is still serialised:{"adjustmentID":"","createdAt":"0001-01-01T00:00:00Z","status":"","error":"","metadata":null}createPayoutandcreateTransferwrite aSCHEDULED_FOR_PROCESSINGadjustment wheneverscheduledAtis in the future, so every scheduled initiation hits this path. The generated v2 SDK then cannot decode the response, because""is not aTransferInitiationStatus:The behaviour dates from #374 (2025-03-24), which introduced the drop. #821 routed the get handler through
translateLastStatusbut kept this loop as it was.Fix
Build the slice with
append(capacitylen(from)), so an adjustment thattranslateStatusdrops is actually left out.NOT_INITIATEDis still reported asFAILED, as before.Tests
handler_transfer_initiations_get_test.go. It returns[PROCESSING, SCHEDULED_FOR_PROCESSING]adjustments from the mocked backend, then checks:PROCESSINGentry comes back;components.TransferInitiationResponse.main(e5c4afad) the spec fails withlen: 2(the second entry is the blank one). With the fix it passes.go test ./internal/api/v2/ ./internal/api/v3/passes, also withGOTOOLCHAIN=go1.26.1.go build ./...andgo vet ./internal/api/v2/pass.golangci-lint run --build-tags it ./internal/api/v2/(v2.14, repo.golangci.yml) reports 0 issues.This PR was prepared by an AI agent (Claude Code, run by breken-ai). The regression test and checks above were run locally before opening it.
🤖 Generated with Claude Code