Skip to content

Fix SlackAPI session initialization race condition ( Sentry ID OPERATIONCODE-PYBOT-4T )#417

Merged
irvingpop merged 1 commit intomasterfrom
irving/fix_issues_post_python_upgrade
Jan 6, 2026
Merged

Fix SlackAPI session initialization race condition ( Sentry ID OPERATIONCODE-PYBOT-4T )#417
irvingpop merged 1 commit intomasterfrom
irving/fix_issues_post_python_upgrade

Conversation

@irvingpop
Copy link
Copy Markdown
Collaborator

The SlackAPI was being initialized in plugin.load() before the aiohttp session existed, causing '_session' to be None. This led to production errors: "AttributeError: 'NoneType' object has no attribute 'request'".

Solution:

  • Defer SlackAPI initialization to startup callback after session creation
  • Make _initialize_api() idempotent to preserve test mocks
  • Update test fixtures to manually trigger initialization when needed

…IONCODE-PYBOT-4T )

The SlackAPI was being initialized in plugin.load() before the aiohttp
session existed, causing '_session' to be None. This led to production
errors: "AttributeError: 'NoneType' object has no attribute 'request'".

Solution:
- Defer SlackAPI initialization to startup callback after session creation
- Make _initialize_api() idempotent to preserve test mocks
- Update test fixtures to manually trigger initialization when needed
@irvingpop irvingpop merged commit 7759198 into master Jan 6, 2026
1 check passed
@irvingpop irvingpop deleted the irving/fix_issues_post_python_upgrade branch January 6, 2026 00:24
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