Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: address issue causing failure to receive heartbeat #435

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/wechaty/wechaty.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ async def heartbeat_listener(payload: EventHeartbeatPayload) -> None:
self.emit('heartbeat', payload.data)
await self.on_heartbeat(payload)

puppet.on('heart-beat', heartbeat_listener)
puppet.on('heartbeat', heartbeat_listener)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

The event name 'heart-beat' still exists in the code and needs to be updated

Found remaining instances of 'heart-beat' in src/wechaty/wechaty.py that need to be updated for consistency:

  • Line with elif event_name == 'heart-beat': The condition should use 'heartbeat'
  • Line with log.info('receive <heart-beat> event <%s>', payload): The log message should use 'heartbeat'
🔗 Analysis chain

LGTM! The event name change looks correct.

The change from 'heart-beat' to 'heartbeat' aligns with:

  1. The emit function's usage of 'heartbeat'
  2. The naming convention of other events in the codebase
  3. The event name in puppet.py

Let's verify there are no other occurrences of 'heart-beat' that need to be updated:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining instances of 'heart-beat' in the codebase
rg "heart-beat" -l

# Search for heartbeat event usage to ensure consistency
rg "heartbeat" -A 2 -B 2

Length of output: 2532


elif event_name == 'friendship':
async def friendship_listener(payload: EventFriendshipPayload) -> None:
Expand Down