Skip to content

fix: log the topic for an invalid subscription - #4

Draft
chipkent wants to merge 1 commit into
masterfrom
fix/ws-logging-format
Draft

chipkent wants to merge 1 commit into
masterfrom
fix/ws-logging-format

Conversation

@chipkent

@chipkent chipkent commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Preview only. This is a draft in the fork showing the exact text of the PR planned for massive-com/client-python. It will be closed, not merged, once the upstream PR is opened.

Fixes #<issue: F3>

subscribe("AAPL") (a topic without a channel prefix) calls logger.warning("invalid subscription:", s). The message has no placeholder for s, so logging prints --- Logging error --- and a traceback, and the rejected topic is never shown.

  • Use logger.warning("invalid subscription: %s", s). The warning now reads invalid subscription: AAPL.
  • The invalid topic is still skipped, as before.
  • One test in test_websocket/test_status.py goes through subscribe(). It fails on master.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chipkent
chipkent force-pushed the fix/ws-logging-format branch 2 times, most recently from 0672d7e to 636ec07 Compare October 24, 2026 03:27
_parse_subscription called logger.warning("invalid subscription:", s),
passing the topic as a format argument with no placeholder. Logging
printed "--- Logging error ---" and a traceback instead of the warning,
and the rejected topic was never shown.

Use a %s placeholder so the warning reads "invalid subscription: <topic>",
and add a test to test_status.py that goes through subscribe().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant