slackapi / slackapi/python-slack-sdk

Disable historical_data_enabled in SQLAlchemyInstallationStore / SQLite3InstallationStore

オープン
#1,133 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement oauth Version: 3x
主要言語
Python
スター
4k
フォーク
857
平均マージ
22時間 21分
マージ済み PR(30日)
16

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

slack_sdk/oauth/installation_store/sqlalchemy/init.py の、関連する installed_at の検索箇所から始め、履歴レコードの扱いを FileInstallationStore および SQLite3InstallationStore と比較します。再インストールのマッチングに historical_data_enabled がどのように影響すべきかを判断してください。再インストールが想定される非履歴動作に従い、新しいレコードを必要としなければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, sqlalchemy, sqlite
領域
databases
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。