Repository navigation
Conversation
[Medium impact] The reply-topic change reaches the bot-control commands that share this publisher. Fix the shared reply-topic collision before merging so commands cannot supply the reply to a history request. Findings
SummaryChanges
Reviews (1) · Last reviewed commit: "fix: update reply_to topic format in MQT..." · Reviewed by Greptile |
| "header": { | ||
| "timestamp": int(time.time() * 1000), # Milliseconds | ||
| "reply_to": f"hummingbot-api-response-{int(time.time() * 1000)}", # Unique response topic | ||
| "reply_to": f"hummingbot-api/response/{int(time.time() * 1000)}", # Matches the subscribed response topic |
There was a problem hiding this comment.
publish_command() now uses the same millisecond-only reply topic as publish_command_and_wait(). When a start, stop, or config request and a history request generate their topics in the same millisecond, the command reply can arrive first and satisfy the history request. _handle_rpc_response() checks only the topic, so the API returns the command's reply as successful history data and discards the real history reply.
Give each request a unique topic, such as a UUID-based suffix, while keeping the allowed prefix.
Summary
MQTTManager.publish_command()setreply_totohummingbot-api-response-<ts>(dash format). The API doesn't subscribe to that topic, and the stock deploy EMQX ACL denies it, so every start/stop/config command caused an AUTHZ denial and a dead-letter reply.This changes it to
hummingbot-api/response/<ts>, matching the existing subscription (hummingbot-api/response/+) and the generic RPC path in the same module.Closes #256
Notes
hbot/<bot>/response/...); this only removes the broker/bot log noise._handle_rpc_responselogs "No pending RPC response" once per command, sincepublish_command()is fire-and-forget.