Repository navigation
feat(orders): force-cancel a stuck order from the order menu (MoonBot 7.73 N2) - #1488
Merged
Merged
Conversation
… 7.73 N2) - moon-core: CoreFeatures, detected from the RuntimeState tails moonproto documents per build (moon_stream_enabled = 7.73 N1, moon_streamer = N2), mirrored per core into the store and forgotten on any departure from Ready or a server restart. Carries the N1 exchange-wide buys cancel flag for the follow-up. - CoreCmd::ForceCancelOrder, a sibling of CancelOrder, routed to orders().force_cancel and classified as a live action. - The order menu offers "Force cancel..." only for a BuySet/SellSet order on an N2 core; on an older or unreported core the row is disabled with the reason. A confirmation states that the order may remain open on the exchange; the answer re-checks the workspace, the eligibility and the leg captured when the menu opened, and the toast says sent, not cancelled. - Locale keys in all eight languages.
The synthetic feed sent RuntimeState but never CoreFeatures, so the store kept the default on every synthetic core and the order menu's force-cancel row (and the N1 exchange-entries control that reuses the flag) stayed disabled on the fixture, the benches and the capture build. The synthetic core stands in for a current core, so it now announces both the N1 and the N2 commands right after its RuntimeState, after Ready (the store forgets the build on any other status). Its command drain executes no command, so a forced cancellation is dropped exactly like an ordinary one; a test pins that the stream survives it.
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.
What & why
MoonBot 7.73 N2 can force-cancel a stuck order: the core drops it from its own tracking even when the exchange did not confirm the cancel. The terminal now offers Force cancel… in the order menu.
CoreFeatures, detected from the RuntimeState tails MoonProto documents per build (moon_stream_enabled= 7.73 N1,moon_streamer= N2; both builds report version 773, so the number cannot tell them apart). Mirrored per core into the store and forgotten on any departure from Ready or a server restart. Also carries the N1 flag the exchange-entries PR uses.CoreCmd::ForceCancelOrder, a sibling ofCancelOrder, routed toorders().force_cancel()and classified as a live action.Notable decisions
Known limitations
Okfrom the SDK means the request was queued; the result arrives as normal order updates. Older cores ignore the request, which is why the item is gated.Issues
None of the open issues tracks force-cancel. #1211 (cancel a filled order and keep the coins) is a different action and is not touched.
How to verify
Local, after the rebase on
44b01ffcd: fmt--checkexit 0, build--all-targetsexit 0, clippy--workspace --all-targets --locked -D warningszero warnings,cargo test --workspace10595 passed / 0 failed, doc-tests green.