Repository navigation
Conversation
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.
Summary
A single
TradeContext::cancel_ordercall goes through the JSON sender's rate-limit retry loop. With an empty HTTP 429 response on every attempt, a loopback server observed sixDELETE /v1/trade/orderrequests for one cancellation on SDK 5.5.0 and 5.6.1 with both API key and OAuth authentication. If a later attempt succeeds, the caller can also miss the initial rate-limit error.Add
RequestBuilder::send_onceusing the existing signed request and response handling. Use it for order cancellation so the caller receives the first rate-limit error and can decide whether and when to retry. Order queries keep their current backoff behavior. The public trade method's signature is unchanged.Regression coverage
The loopback test calls the public
cancel_orderandtoday_ordersmethods. Its server returns two empty 429 responses followed by a valid success envelope. On the unpatched main revision the cancellation consumes all three responses and returns success. With this change the server observesDELETE, GET, GET: cancellation returns the first 429 with its trace ID and body, and the order query retries successfully.cargo test -p longbridge -p longbridge-httpcli --lib— 115 SDK tests and 25 HTTP client tests passed.cargo +nightly fmt --allandgit diff --checkpassed.cargo clippy --all --all-featurespassed for the full workspace.TradeContextloopback on the candidate with API key and OAuth authentication: six cases passed. Each cancellation sent one DELETE for a persistent empty 429, an API-error JSON 429, or a successful JSON 200. The status or business error and trace ID were preserved in the failure cases.