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

fix: auto re-init data.json when schema updated #2316

Merged
merged 3 commits into from
Mar 20, 2020

Conversation

boydc2014
Copy link
Contributor

@boydc2014 boydc2014 commented Mar 20, 2020

Description

When the data.json used (the server data store) doesn't align with the new data.json template, we consider composer has been updated, and simply re-init data.json. later we may consider do a gracefully update.

Given our multi-user work, which introduced a new key in data.json, this will help user clean recent history and do a fresh start.

I also clean up ABS-related logic of initializing data store.

Task Item

fixes #2315

@boydc2014 boydc2014 changed the base branch from stable to master March 20, 2020 14:14
@a-b-r-o-w-n
Copy link
Contributor

@boydc2014 what if instead we just wrote a version into the data?

@boydc2014
Copy link
Contributor Author

boydc2014 commented Mar 20, 2020

@boydc2014 what if instead we just wrote a version into the data?

if we don't reuse same key for different purpose, comparing keys might be good enough. Adding a explicit version means any time we want to update the schema of data.json, developer needs to update this version manually in a correct format. I don't know, i feel like it would be a little bit error-prone, "keys" here implicitly indicate a version, somehow. what do you think

@github-actions
Copy link

Coverage Status

Coverage decreased (-0.006%) to 39.29% when pulling 3749159 on donglei/auto-update-datajson into be6f928 on master.

@boydc2014
Copy link
Contributor Author

@boydc2014 what if instead we just wrote a version into the data?

if we don't reuse same key for different purpose, comparing keys might be good enough. Adding a explicit version means any time we want to update the schema of data.json, developer needs to update this version manually in a correct format. I don't know, i feel like it would be a little bit error-prone, "keys" here implicitly indicate a version, somehow. what do you think

Offline synced with @a-b-r-o-w-n , i'm convinced let's start add a version here and leverage the generic data migration mechanism to achieve this.

@a-b-r-o-w-n a-b-r-o-w-n merged commit a953d80 into master Mar 20, 2020
@a-b-r-o-w-n a-b-r-o-w-n deleted the donglei/auto-update-datajson branch March 20, 2020 15:25
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* auto update data.json when schema updated

* fix lint

* add a version number and use generic migration to do re-init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open bot from history hit errors
2 participants