Skip to content

fix: reject invalid chat unread counts#816

Merged
shuxueshuxue merged 1 commit intodevfrom
brother/chat-tool-send-unread-count-contract
Apr 18, 2026
Merged

fix: reject invalid chat unread counts#816
shuxueshuxue merged 1 commit intodevfrom
brother/chat-tool-send-unread-count-contract

Conversation

@shuxueshuxue
Copy link
Copy Markdown
Collaborator

Summary

  • fail loudly when ChatToolService send_message receives a malformed count_unread result
  • preserve the read-before-send gate by stopping before send side effects

Verification

  • uv run python -m pytest tests/Integration/test_messaging_social_handle_contract.py -q -k unread_count_is_invalid
  • uv run python -m pytest tests/Integration/test_messaging_social_handle_contract.py tests/Unit/backend/web/services/test_chat_delivery_hook.py tests/Unit/messaging/test_chat_delivery_dispatcher.py -q
  • uv run ruff format messaging/tools/chat_tool_service.py tests/Integration/test_messaging_social_handle_contract.py --check
  • uv run ruff check messaging/tools/chat_tool_service.py tests/Integration/test_messaging_social_handle_contract.py
  • .venv/bin/python -m pyright messaging/tools/chat_tool_service.py
  • git diff --check

@shuxueshuxue shuxueshuxue merged commit b327d52 into dev Apr 18, 2026
7 checks passed
@shuxueshuxue shuxueshuxue deleted the brother/chat-tool-send-unread-count-contract branch April 18, 2026 23:05
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