Skip to content

Commit

Permalink
Fix #1592 by encoding aiohttp client session pings (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonwbarnett authored Nov 19, 2024
1 parent 6bcf7ec commit c3999d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slack_sdk/socket_mode/aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ async def monitor_current_session(self) -> None:
if self.last_ping_pong_time is None:
self.last_ping_pong_time = float(t)
try:
await session.ping(f"sdk-ping-pong:{t}")
await session.ping(f"sdk-ping-pong:{t}".encode("utf-8"))
except Exception as e:
# The ping() method can fail for some reason.
# To establish a new connection even in this scenario,
Expand Down Expand Up @@ -387,7 +387,7 @@ async def connect(self):
if self.logger.level <= logging.DEBUG:
self.logger.debug(f"Sending a ping message with the newly established connection ({session_id})...")
t = time.time()
await self.current_session.ping(f"sdk-ping-pong:{t}")
await self.current_session.ping(f"sdk-ping-pong:{t}".encode("utf-8"))

if self.current_session_monitor is not None:
self.current_session_monitor.cancel()
Expand Down

0 comments on commit c3999d6

Please sign in to comment.