fix(settings): send the global blacklist through the compact channel - #546
Merged
Conversation
The gear popup and the expert window wrote the core's global coin blacklist as part of the safe-share packet (TSharedConfigCommand). The core stores that text and echoes it back, but never rebuilds its per-market "blacklisted" flag from it — measured on a live core: a coin removed from the terminal stayed blocked for a strategy whitelisted on it until the list was touched in the core's own window, while every echo and the core's GUI showed it gone. The core developer confirmed the compact TClientSettingsCommand is the path that calls RebuildMarketsBL. Both surfaces now send the two blacklist fields through CoreCmd::SetBlacklist — the path the coin context menu already used — ahead of the page, and only when the surface's own user changed them against the page it was seeded from: the draft is frozen once touched, and an OK on an unrelated row would otherwise carry the frozen list out and undo a coin added meanwhile from the context menu, a second terminal or the core's Telegram bot. The safe-share applier leaves the two fields alone for the same reason; the packet carries whatever the core holds when it is built. Verified live: removal reached the strategies 0.7 s after OK, the safe-share packet was not even needed.
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
A user reported: a coin added to the core's global blacklist via the Telegram bot, then removed in MoonTerminal, stayed blocked — the core's log kept saying
match global black listwhile its own window and every settings echo showed the coin gone; adding and removing it again in the core's window fixed it.Reproduced on a live core with a strategy whitelisted on one coin as the probe. The gear popup and the expert window wrote the blacklist (
use_coins_black_list/coins_black_list_text) as part of the full safe-share packet (TSharedConfigCommand). The core stores that text and echoes it back but never rebuilds its per-market "blacklisted" flag from it. The core developer confirmed that the compactTClientSettingsCommandis the path that callsRebuildMarketsBL— the path the coin context menu already used.Both surfaces now send the two fields through
CoreCmd::SetBlacklistahead of the page; the safe-share applier leaves them alone, so the packet carries whatever the core holds when it is built.Notable decisions
apply_general), for the same reason: with the blacklist owned by one channel, the page cannot paint the core's echo over with a stale copy. The round-trip test now asserts the field does not pass through.TSharedConfigCommandat all.Known limitations
ClientSettingsparks the safe-share writes behind it for the connection. This change adds no new exposure beyond what the coin context menu already had, and only on an actual blacklist edit; a timeout in that queue is a separate change.TSharedConfigCommandnot rebuilding the market flag) is not fixed here and, per the core developer, not planned; the terminal avoids the path instead.Issues
None of the 17 open issues is touched by this change.
How to verify
fmt
--checkexit 0; build pass; clippy: no finding in the touched files (pre-existing debt elsewhere unchanged); moon-core 1955 passed, moon-ui-gpui 1810 + theme_contract 333 passed, 0 failed. FireTest not run — no chart/render/window/input surface.Live: on a core with a coin blacklisted and a strategy whitelisted on it, removing the coin in the gear popup → compact packet sent → core echo without the coin → core
Global BL:line → both strategies placed buys 0.7 s after OK; the safe-share packet was not needed. Twice. The reverse edit in the core's own window cancelled those orders withmatch global black list.🤖 Generated with Claude Code