Skip to content

Commit

Permalink
fix: data race writing on setting file (microsoft#7475)
Browse files Browse the repository at this point in the history
* fix data race writing on setting file

* remove isSkill in skillConfiguration

* remove default allowedCallers value

Co-authored-by: TJ Durnford <tjdford@gmail.com>
Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Co-authored-by: Ben Yackley <61990921+beyackle@users.noreply.github.com>
Co-authored-by: Soroush <hatpick@gmail.com>
  • Loading branch information
5 people committed May 6, 2021
1 parent 9c68f04 commit 79075d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Composer/packages/server/src/models/bot/botProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ export class BotProject implements IBotProject {
// if endpointKey has not been set, migrate old key to new key
if (!settings.qna.endpointKey) {
settings.qna.endpointKey = settings.qna.endpointkey;
delete settings.qna.endpointkey;
await this.updateEnvSettings(settings);
}
delete settings.qna.endpointkey;
await this.updateEnvSettings(settings);
}

// set these after migrating qna settings to not write them to storage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export class DefaultSettingManager extends FileSettingManager {
maxImbalanceRatio: -1,
},
skill: {},
skillConfiguration: {},
defaultLanguage: 'en-us',
languages: ['en-us'],
customFunctions: [],
Expand Down
4 changes: 2 additions & 2 deletions extensions/packageManager/src/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ export default async (composer: IExtensionRegistration): Promise<void> => {
newlyInstalledPlugin &&
!currentProject.settings.runtimeSettings?.components?.find((p) => p.name === newlyInstalledPlugin.name)
) {
const newSettings = currentProject.settings;
const newSettings = await currentProject.getEnvSettings();
if (!newSettings.runtimeSettings) {
newSettings.runtimeSettings = {
components: [],
Expand Down Expand Up @@ -475,7 +475,7 @@ export default async (composer: IExtensionRegistration): Promise<void> => {

// update the settings.components array
if (currentProject.settings.runtimeSettings?.components?.find((p) => p.name === packageName)) {
const newSettings = currentProject.settings;
const newSettings = await currentProject.getEnvSettings();
newSettings.runtimeSettings.components = newSettings.runtimeSettings.components.filter(
(p) => p.name !== packageName
);
Expand Down

0 comments on commit 79075d8

Please sign in to comment.