diff --git a/slack_sdk/oauth/installation_store/amazon_s3/__init__.py b/slack_sdk/oauth/installation_store/amazon_s3/__init__.py index c5c420f12..9a915c77c 100644 --- a/slack_sdk/oauth/installation_store/amazon_s3/__init__.py +++ b/slack_sdk/oauth/installation_store/amazon_s3/__init__.py @@ -106,7 +106,7 @@ def save(self, installation: Installation): def save_bot(self, bot: Bot): if bot.bot_token is None: - self.logger.debug("Skipped saving a new row because of the absense of bot token in it") + self.logger.debug("Skipped saving a new row because of the absence of bot token in it") return none = "none" @@ -273,7 +273,7 @@ def delete_bot(self, *, enterprise_id: Optional[str], team_id: Optional[str]) -> Key=content.get("Key"), ) except Exception as e: - message = f"Failed to find bot installation data for enterprise: {e_id}, team: {t_id}: {e}" + message = f"Failed to delete bot installation data for enterprise: {e_id}, team: {t_id}: {e}" raise SlackClientConfigurationError(message) async def async_delete_installation( @@ -316,7 +316,7 @@ def delete_installation( ) deleted_keys.append(key) except Exception as e: - message = f"Failed to find bot installation data for enterprise: {e_id}, team: {t_id}: {e}" + message = f"Failed to delete installation data for enterprise: {e_id}, team: {t_id}: {e}" raise SlackClientConfigurationError(message) try: @@ -328,7 +328,7 @@ def delete_installation( ) deleted_keys.append(no_user_id_key) except Exception as e: - message = f"Failed to find bot installation data for enterprise: {e_id}, team: {t_id}: {e}" + message = f"Failed to delete installation data for enterprise: {e_id}, team: {t_id}: {e}" raise SlackClientConfigurationError(message) # Check the remaining installation data @@ -347,5 +347,5 @@ def delete_installation( Key=content.get("Key"), ) except Exception as e: - message = f"Failed to find bot installation data for enterprise: {e_id}, team: {t_id}: {e}" + message = f"Failed to delete installation data for enterprise: {e_id}, team: {t_id}: {e}" raise SlackClientConfigurationError(message) diff --git a/slack_sdk/oauth/installation_store/async_cacheable_installation_store.py b/slack_sdk/oauth/installation_store/async_cacheable_installation_store.py index 935d24fe4..4edc638ef 100644 --- a/slack_sdk/oauth/installation_store/async_cacheable_installation_store.py +++ b/slack_sdk/oauth/installation_store/async_cacheable_installation_store.py @@ -98,7 +98,8 @@ async def async_delete_bot( team_id=team_id, ) key = f"{enterprise_id or ''}-{team_id or ''}" - self.cached_bots.pop(key) + if key in self.cached_bots: + self.cached_bots.pop(key) async def async_delete_installation( self, diff --git a/slack_sdk/oauth/installation_store/file/__init__.py b/slack_sdk/oauth/installation_store/file/__init__.py index e178048b4..aa6f6c52d 100644 --- a/slack_sdk/oauth/installation_store/file/__init__.py +++ b/slack_sdk/oauth/installation_store/file/__init__.py @@ -78,7 +78,7 @@ def save(self, installation: Installation): def save_bot(self, bot: Bot): if bot.bot_token is None: - self.logger.debug("Skipped saving a new row because of the absense of bot token in it") + self.logger.debug("Skipped saving a new row because of the absence of bot token in it") return none = "none" diff --git a/slack_sdk/oauth/installation_store/sqlite3/__init__.py b/slack_sdk/oauth/installation_store/sqlite3/__init__.py index 6e65805fe..42f9c6ad8 100644 --- a/slack_sdk/oauth/installation_store/sqlite3/__init__.py +++ b/slack_sdk/oauth/installation_store/sqlite3/__init__.py @@ -217,7 +217,7 @@ def save(self, installation: Installation): def save_bot(self, bot: Bot): if bot.bot_token is None: - self.logger.debug("Skipped saving a new row because of the absense of bot token in it") + self.logger.debug("Skipped saving a new row because of the absence of bot token in it") return with self.connect() as conn: