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 #1636 Custom Values passed into correctly into Bot/Installation class when cloned during token rotation #1638

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

seratch
Copy link
Member

@seratch seratch commented Jan 22, 2025

Summary

This pull request resolves #1636

Category

  • 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 (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • 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.

…lation class when cloned during token rotation
@seratch seratch added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented web-client Version: 3x oauth labels Jan 22, 2025
@seratch seratch added this to the 3.34.1 milestone Jan 22, 2025
@seratch seratch self-assigned this Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.04%. Comparing base (c9fff5d) to head (8e43572).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
slack_sdk/oauth/token_rotation/async_rotator.py 66.66% 1 Missing ⚠️
slack_sdk/oauth/token_rotation/rotator.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1638   +/-   ##
=======================================
  Coverage   85.03%   85.04%           
=======================================
  Files         113      113           
  Lines       12659    12665    +6     
=======================================
+ Hits        10765    10771    +6     
  Misses       1894     1894           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

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

These changes look good to me 💯 thanks for working on this

Left one comment about how to treat these changes in the next major, but its not blocking

@@ -190,6 +190,11 @@ def to_dict(self) -> Dict[str, Any]:
"token_type": self.token_type,
"installed_at": datetime.utcfromtimestamp(self.installed_at),
}

def to_dict_for_copying(self) -> Dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

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

In the next major version of this project should we remove these changes and make to_dict behave like to_dict_for_copying?
If so should we add a TODO comment here that informs maintainer to do this in the next major?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! Changing the behavior may break existing apps, so I personally don't think we should modify to_dict method. For instance, your custom InstallationStore may generate a dict object using the method and save it in simple data storage like Amazon S3. That said, if our future maintainers decide to change for a certain reason, I don't oppose to it at all.

@seratch seratch merged commit fcd0a35 into slackapi:main Jan 24, 2025
13 checks passed
@seratch seratch deleted the issue-1636 branch January 24, 2025 04:13
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 oauth Version: 3x web-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Values passed into correctly into Bot/Installation class when cloned during token rotation
2 participants