Repository navigation
fix(orderbook): continue reduce-only close recovery when a cancelled order fills - #349
Merged
Merged
Conversation
…order fills A reduce-only rejection (90802022) near the tail of a continuous close makes the recovery cancel selected close orders. When one of them fully fills after it was selected, its cancellation is rejected and no matching success receipt exists, so the task stopped with "未收到匹配的成功撤单回执". A live JCTUSDT close stopped that way at round 202/204 while its last four close orders filled in the same second and the position reached zero. During reduce-only recovery an unconfirmed cancellation now waits up to 3 s for a trusted account-stream FILLED frame for that exact identity and its whole preflight quantity. FILLED is terminal, so the page keeps the latest 200 whole-order fill frames and each batch starts from them. With that evidence the batch ends like a vanished target: nothing is counted as released and the runner rereads the authoritative position. Partial fills, foreign identities or no frame keep the existing stop; ordinary replacements still stop. Every unconfirmed cancellation now logs its first observed reason (not dispatched, HTTP status, response code, another order, no/unreadable response, multiple requests, response or account-event timeout). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Near the tail of a continuous close, reduce-only recovery (after
90802022) cancels selected close orders. If a selected order fully fills after selection, its cancellation is rejected and no matching success receipt exists, and the task stopped with未收到匹配的成功撤单回执,已停止重新挂单. Live JCTUSDT: stopped at round 202/204 while its last four close orders filled in the same second; the position ended at zero.Change (2.7.247)
FILLEDframe for the exact identity (symbol, orderId, clientOrderId) and whole preflight quantity.FILLEDis terminal, so the page keeps the latest 200 whole-order fill frames and each cancellation batch starts from them (covers a fill that arrives before the batch while the row is still rendered).Cancellation not confirmedwith the first observed reason and whether fill evidence arrived.Validation
npm test2661 passed;npm run test:ui670 passed;lint:tests,lint:ui-copy,check:binance-userscripts,check:binance-orderbook-trade,git diff --checkpass.🤖 Generated with Claude Code