Skip to content

fix(oauth): save installer-latest in FileInstallationStore when historical data is disabled - #1986

Open
abhishekacharya200 wants to merge 1 commit into
slackapi:mainfrom
abhishekacharya200:fix-file-installation-store-no-history
Open

abhishekacharya200 wants to merge 1 commit into
slackapi:mainfrom
abhishekacharya200:fix-file-installation-store-no-history

Conversation

@abhishekacharya200

Copy link
Copy Markdown

Summary

When FileInstallationStore is created with historical_data_enabled=False, save() only writes installer-{user_id}-latest. find_installation() without a user_id reads installer-latest, which is never written in that mode, so it always returns None. This includes the lookup Bolt's default authorize does on every request.

store = FileInstallationStore(historical_data_enabled=False)
store.save(installation)  # enterprise_id="E111", team_id="T111", user_id="U111"
store.find_installation(enterprise_id="E111", team_id="T111")  # None

This change makes the non-historical branch also write installer-latest. AmazonS3InstallationStore already does this in the same mode. The historical-data path is unchanged.

Testing

pytest tests/slack_sdk/oauth/installation_store/test_file.py

The new test_save_and_find_without_historical_data fails on main and passes with this change. It uses a temporary base_dir, so it doesn't write to the home directory.

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.

…rical data is disabled

With historical_data_enabled=False, FileInstallationStore.save() only wrote the per-user installer file, so find_installation() without a user_id never found the installation. Write the workspace-level installer-latest file as well, matching AmazonS3InstallationStore.
@abhishekacharya200
abhishekacharya200 requested a review from a team as a code owner October 16, 2026 05:48
@salesforce-cla

Copy link
Copy Markdown

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

@abhishekacharya200

Copy link
Copy Markdown
Author

I have signed the Salesforce CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant