Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable historical_data_enabled in SQLAlchemyInstallationStore / SQLite3InstallationStore #1133

Open
olexatourko opened this issue Nov 14, 2021 · 2 comments
Labels
enhancement M-T: A feature request for new functionality oauth Version: 3x
Milestone

Comments

@olexatourko
Copy link

olexatourko commented Nov 14, 2021

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:

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.

@olexatourko olexatourko changed the title SQL Alchemy Installation Store (Question) Handling reinstalls with SQLAlchemyInstallationStore Nov 14, 2021
@olexatourko
Copy link
Author

I did it by calling delete_all(enterprise_id, team_id) before storing the new installation. Still would be handy to have a flag instead though 😉

@seratch seratch added this to the 3.x milestone Nov 14, 2021
@seratch seratch added enhancement M-T: A feature request for new functionality oauth Version: 3x and removed untriaged labels Nov 14, 2021
@seratch seratch changed the title (Question) Handling reinstalls with SQLAlchemyInstallationStore Add historical_data_enabled option to SQLAlchemyInstallationStore / SQLite3InstallationStore Nov 14, 2021
@seratch
Copy link
Member

seratch commented Nov 14, 2021

Hi @olestourko, thanks for taking the time to write in here!

Indeed, the historical_data_enabled flag option is not available in the relational database based Installation Store implementation (specifically, SQLAlchemyInstallationStore and SQLite3InstallationStore).

We're open to the idea of adding the feature in the future but it won't be a short-term priority. If you operate production-grade apps, we recommend having all the installation history data for safety and for easier troubleshooting.

To disable historical data management right now, please go with your workaround or implement your own InstallationStore for it.

@seratch seratch changed the title Add historical_data_enabled option to SQLAlchemyInstallationStore / SQLite3InstallationStore Disable historical_data_enabled in SQLAlchemyInstallationStore / SQLite3InstallationStore Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality oauth Version: 3x
Projects
None yet
Development

No branches or pull requests

2 participants