slackapi / slackapi/python-slack-sdk

Disable historical_data_enabled in SQLAlchemyInstallationStore / SQLite3InstallationStore

Open
#1,133 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement oauth Version: 3x
Dominant language
Python
Stars
4k
Forks
857
Avg merge
22h 21m
Merged PRs (30d)
16

Description

I'm migrating from FileInstallationStore to SQLAlchemyInstallationStore for storing credentials and don't want to store old installation records when the app is reinstalled.

With FileInstallationStore I used the flag for disabling historical records to do this. I'm trying to accomplish the same with SQLAlchemyInstallationStore and the SDK does check if a previous installation for the team exists and updates the existing record if so. However, in determining if a previous installation exists it requires an exact match on installed_at: https://github.com/slackapi/python-slack-sdk/blob/cf225995b722739f11bc530cc6a9263a44bd4b7a/slack_sdk/oauth/installation_store/sqlalchemy/__init__.py#L148

This guarantees that reinstalls always create a new record instead of updating the existing one since the install dates will always be different. I'm wondering if this is a bug or if its expected behaviour and there's some other way we're supposed to handle reinstalls.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at slack_sdk/oauth/installation_store/sqlalchemy/init.py around the linked installed_at lookup, then compare the historical-record handling with FileInstallationStore and the SQLite3InstallationStore. Determine how historical_data_enabled should affect reinstall matching; done means reinstalls follow the intended non-historical behavior without requiring a new record.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlalchemy, sqlite
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.