Repository navigation
fix(oauth): save installer-latest in FileInstallationStore when historical data is disabled - #1986
Open
abhishekacharya200 wants to merge 1 commit into
Conversation
…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.
|
Thanks for the contribution! Before we can merge this, we need @abhishekacharya200 to sign the Salesforce Inc. Contributor License Agreement. |
Author
|
I have signed the Salesforce CLA. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When
FileInstallationStoreis created withhistorical_data_enabled=False,save()only writesinstaller-{user_id}-latest.find_installation()without auser_idreadsinstaller-latest, which is never written in that mode, so it always returnsNone. This includes the lookup Bolt's default authorize does on every request.This change makes the non-historical branch also write
installer-latest.AmazonS3InstallationStorealready does this in the same mode. The historical-data path is unchanged.Testing
pytest tests/slack_sdk/oauth/installation_store/test_file.pyThe new
test_save_and_find_without_historical_datafails onmainand passes with this change. It uses a temporarybase_dir, so it doesn't write to the home directory.Category
/docs(Documents)/tutorial(PythOnBoardingBot tutorial)tests/integration_tests(Automated tests for this library)Requirements
python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.shafter making the changes.