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 AttributeError on SocketModeClient.is_connected (aiohttp) when enabling debug-level logging #1499

Closed
wants to merge 2 commits into from

Conversation

cxong
Copy link
Contributor

@cxong cxong commented May 22, 2024

In a new aiohttp SocketModeClient, when self.current_session is None, calling is_connected and going into the detailed logging section will attempt to access self.current_session.closed and lead to an AttributeError

Summary

Fix bug where calling is_connected will lead to an AttributeError

Category (place an x in each of the [ ])

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs-src (Documents, have you run ./scripts/docs.sh?)
  • /docs-src-v2 (Documents, have you run ./scripts/docs-v2.sh?)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements (place an x in each [ ])

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

…logging

In a new aiohttp SocketModeClient, when self.current_session is None, calling is_connected and going into the detailed logging section will attempt to access self.current_session.closed and lead to an AttributeError
Copy link

Thanks for the contribution! Before we can merge this, we need @cxong to sign the Salesforce Inc. Contributor License Agreement.

@seratch seratch changed the title Fix aiohttp SocketModeClient.is_connected AttributeError in detailed … Fix aiohttp SocketModeClient.is_connected AttributeError in detailed logging May 22, 2024
@seratch seratch self-assigned this May 22, 2024
@seratch seratch added this to the 3.27.3 milestone May 22, 2024
@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 3x socket-mode labels May 22, 2024
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM; once the CI builds pass, we'll merge this PR

@seratch seratch changed the title Fix aiohttp SocketModeClient.is_connected AttributeError in detailed logging Fix AttributeError on SocketModeClient.is_connected (aiohttp) when enabling debug-level logging May 22, 2024
@seratch
Copy link
Member

seratch commented May 22, 2024

It seems that CI builds are pretty slow now and they resulted in timeout errors. I will check the issue later this week

@seratch
Copy link
Member

seratch commented Jun 5, 2024

Thanks for the contribution! Your changes have been merged by this commit: 089afec

@seratch seratch closed this Jun 5, 2024
@seratch seratch modified the milestones: 3.27.3, 3.28.0 Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented cla:signed socket-mode Version: 3x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants